mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 16:59:18 +00:00
Avoid crash when module required by autoload is not available
git-svn-id: https://svn.fhem.de/fhem/trunk@575 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a62ec35db4
commit
c1d6332c59
@ -159,7 +159,7 @@ my $nextat; # Time when next timer will be triggered.
|
|||||||
my $intAtCnt=0;
|
my $intAtCnt=0;
|
||||||
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
||||||
my $duplidx=0; # helper for the above pool
|
my $duplidx=0; # helper for the above pool
|
||||||
my $cvsid = '$Id: fhem.pl,v 1.101 2010-01-29 07:37:47 rudolfkoenig Exp $';
|
my $cvsid = '$Id: fhem.pl,v 1.102 2010-02-24 08:20:37 rudolfkoenig Exp $';
|
||||||
my $namedef =
|
my $namedef =
|
||||||
"where <name> is either:\n" .
|
"where <name> is either:\n" .
|
||||||
"- a single device name\n" .
|
"- a single device name\n" .
|
||||||
@ -2109,7 +2109,6 @@ Dispatch($$$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
my @found;
|
my @found;
|
||||||
my $last_module;
|
|
||||||
foreach my $m (sort { $modules{$a}{ORDER} cmp $modules{$b}{ORDER} }
|
foreach my $m (sort { $modules{$a}{ORDER} cmp $modules{$b}{ORDER} }
|
||||||
grep {defined($modules{$_}{ORDER});}keys %modules) {
|
grep {defined($modules{$_}{ORDER});}keys %modules) {
|
||||||
next if($iohash->{Clients} !~ m/:$m:/);
|
next if($iohash->{Clients} !~ m/:$m:/);
|
||||||
@ -2120,7 +2119,6 @@ Dispatch($$$)
|
|||||||
no strict "refs";
|
no strict "refs";
|
||||||
@found = &{$modules{$m}{ParseFn}}($hash,$dmsg);
|
@found = &{$modules{$m}{ParseFn}}($hash,$dmsg);
|
||||||
use strict "refs";
|
use strict "refs";
|
||||||
$last_module = $m;
|
|
||||||
last if(int(@found));
|
last if(int(@found));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2134,10 +2132,13 @@ Dispatch($$$)
|
|||||||
|
|
||||||
if($attr{global}{autoload_undefined_devices}) {
|
if($attr{global}{autoload_undefined_devices}) {
|
||||||
$mname = LoadModule($mname);
|
$mname = LoadModule($mname);
|
||||||
|
if($modules{$mname} && $modules{$mname}{ParseFn}) {
|
||||||
no strict "refs";
|
no strict "refs";
|
||||||
@found = &{$modules{$mname}{ParseFn}}($hash,$dmsg);
|
@found = &{$modules{$mname}{ParseFn}}($hash,$dmsg);
|
||||||
use strict "refs";
|
use strict "refs";
|
||||||
$last_module = $mname;
|
} else {
|
||||||
|
Log 0, "ERROR: Cannot autoload $mname";
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log GetLogLevel($name,3),
|
Log GetLogLevel($name,3),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user