From 3c24d904d9fd1e2c2b4b1c7a6b58b2a3af864db1 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 16 Sep 2021 15:47:28 +0000 Subject: [PATCH] 93_FHEM2FHEM.pm: avoid crash on startup (Forum #122977) git-svn-id: https://svn.fhem.de/fhem/trunk@24980 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/93_FHEM2FHEM.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/93_FHEM2FHEM.pm b/fhem/FHEM/93_FHEM2FHEM.pm index 0b9361d29..ce4a3d0a1 100644 --- a/fhem/FHEM/93_FHEM2FHEM.pm +++ b/fhem/FHEM/93_FHEM2FHEM.pm @@ -381,8 +381,9 @@ FHEM2FHEM_Set($@) FHEM2FHEM_CloseDev($hash); FHEM2FHEM_OpenDev($hash, 0); } + if($a[1] eq "cmd") { - return "Not connected" if($hash->{STATE} ne "connected"); + return "Not connected" if(!$hash->{TCPDev}); my $cmd = join(" ",@a[2..$#a]); $cmd = '{my $r=fhem("'.$cmd.'");; defined($r) ? "\\0$r\\0" : $r}'."\n"; syswrite($hash->{TCPDev}, $cmd);