From 6643d750e7231096afdb15729c3182b15f50ec2a Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 5 Jan 2019 11:24:19 +0000 Subject: [PATCH] 00_LIRC.pm: do not crash fhem if there is no /etc/lirc (Forum #95324) git-svn-id: https://svn.fhem.de/fhem/trunk@18140 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_LIRC.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/00_LIRC.pm b/fhem/FHEM/00_LIRC.pm index 7304ac3a9..07d417686 100644 --- a/fhem/FHEM/00_LIRC.pm +++ b/fhem/FHEM/00_LIRC.pm @@ -43,13 +43,17 @@ LIRC_Define($$) my $config = $a[2]; Log3 $name, 3, "LIRC opening $name device $config"; - my $lirc = Lirc::Client->new({ + my $lirc; + eval { + $lirc = Lirc::Client->new({ prog => 'fhem', rcfile => "$config", debug => 0, fake => 0, }); - return "Can't open $config: $!\n" if(!$lirc); + }; + return "Error initializing Lirc::Client: $@" if($@); + return "Can't open $config: $!" if(!$lirc); Log3 $name, 3, "LIRC opened $name device $config"; my $select = IO::Select->new();