From ca72a463669ad8ef205ec86d95624583df97a6a1 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 9 Oct 2014 19:21:23 +0000 Subject: [PATCH] fhem.pl: fix warning if ParseFn returns undef (Forum #27737) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6730 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fhem.pl b/fhem.pl index 1d09aa13d..02c3be1d7 100755 --- a/fhem.pl +++ b/fhem.pl @@ -170,6 +170,7 @@ sub cfgDB_svnId; # DefFn - define a "device" of this type # DeleteFn - clean up (delete logfile), called by delete after UndefFn # ExceptFn - called if the global select reports an except field +# FingerprintFn - convert messages for duplicate detection # GetFn - get some data from this device # NotifyFn - call this if some device changed its properties # ParseFn - Interpret a raw message @@ -3031,7 +3032,6 @@ Dispatch($$$) return rejectDuplicate($name,$idx,$addvals) if($isdup); my @found; - my $clientArray = $hash->{".clientArray"}; $clientArray = computeClientArray($hash, $module) if(!$clientArray); @@ -3050,7 +3050,7 @@ Dispatch($$$) last if(int(@found)); } - if(!int(@found)) { + if(!int(@found) || !defined($found[0])) { my $h = $hash->{MatchList}; $h = $module->{MatchList} if(!$h); if(defined($h)) { foreach my $m (sort keys %{$h}) { @@ -3077,7 +3077,7 @@ Dispatch($$$) } } } - if(!int(@found)) { + if(!int(@found) || !defined($found[0])) { DoTrigger($name, "UNKNOWNCODE $dmsg"); Log3 $name, 3, "$name: Unknown code $dmsg, help me!"; return undef; @@ -3097,7 +3097,7 @@ Dispatch($$$) } } - return undef if(!int(@found) || $found[0] eq ""); # Special return: Do not notify + return undef if(!defined($found[0]) || $found[0] eq ""); # Special return: Do not notify foreach my $found (@found) {