2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

MAX: more robustness checks

git-svn-id: https://svn.fhem.de/fhem/trunk@7068 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgehre 2014-11-26 19:50:04 +00:00
parent e60d8f4029
commit 12530c388a

View File

@ -596,10 +596,8 @@ MAX_Parse($$)
return () if($MAX ne "MAX");
Log3 $hash, 5, "MAX_Parse $msg";
#Find the device with the given addr
my $shash = $modules{MAX}{defptr}{$addr};
if(!$shash)
if(!exists($modules{MAX}{defptr}{$addr}))
{
my $devicetype = undef;
$devicetype = $args[0] if($msgtype eq "define" and $args[0] ne "Cube");
@ -614,6 +612,8 @@ MAX_Parse($$)
}
}
my $shash = $modules{MAX}{defptr}{$addr};
#if $isToMe is true, then the message was directed at device $hash, thus we can also use it for sending
if($isToMe) {
$shash->{IODev} = $hash;