From 70f1eb6306ccf980ccc436bdb0c39a302d579b15 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 4 Dec 2016 09:32:57 +0000 Subject: [PATCH] fhem.pl: TRy to fix undefined device (Forum #58090) git-svn-id: https://svn.fhem.de/fhem/trunk@12710 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 3d5755e09..379a62a20 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -3432,6 +3432,7 @@ Dispatch($$$) return rejectDuplicate($name,$idx,$addvals) if($isdup); my @found; + my $parserMod=""; my $clientArray = $hash->{".clientArray"}; $clientArray = computeClientArray($hash, $module) if(!$clientArray); @@ -3447,6 +3448,7 @@ Dispatch($$$) no strict "refs"; $readingsUpdateDelayTrigger = 1; @found = &{$modules{$m}{ParseFn}}($hash,$dmsg); use strict "refs"; $readingsUpdateDelayTrigger = 0; + $parserMod = $m; last if(int(@found)); } @@ -3464,6 +3466,7 @@ Dispatch($$$) no strict "refs"; $readingsUpdateDelayTrigger = 1; @found = &{$modules{$mname}{ParseFn}}($hash,$dmsg); use strict "refs"; $readingsUpdateDelayTrigger = 0; + $parserMod = $mname; last if(defined($found[0])); } else { Log 0, "ERROR: Cannot autoload $mname"; @@ -3524,9 +3527,12 @@ Dispatch($$$) $defs{$found}{LASTInputDev} = $name; } delete($defs{$found}{".noDispatchVars"}); + DoTrigger($found, undef); + } else { + Log 1, "ERROR: >$found< returned by the $parserMod ParseFn is invalid,". + " notfy the module maintainer"; + return undef; } - - DoTrigger($found, undef); } }