From ad0e5917b452939acdb8ad3d2416df2be5caa250 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 4 Jan 2013 06:57:32 +0000 Subject: [PATCH] Fix for crash on Windows if CUN is not reachable at start. Not tested git-svn-id: https://svn.fhem.de/fhem/trunk@2427 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_CUL.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/00_CUL.pm b/fhem/FHEM/00_CUL.pm index 77914a7f0..221845af3 100755 --- a/fhem/FHEM/00_CUL.pm +++ b/fhem/FHEM/00_CUL.pm @@ -949,8 +949,11 @@ CUL_Ready($) # This is relevant for windows/USB only my $po = $hash->{USBDev}; - my ($BlockingFlags, $InBytes, $OutBytes, $ErrorFlags) = $po->status; - return ($InBytes>0); + my ($BlockingFlags, $InBytes, $OutBytes, $ErrorFlags); + if($po) { + ($BlockingFlags, $InBytes, $OutBytes, $ErrorFlags) = $po->status; + } + return ($InBytes && $InBytes>0); } ########################