98_structure.pm: even more checks for undefined devices (Forum #32493)
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7655 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -59,9 +59,10 @@ sub
|
|||||||
structAdd($$)
|
structAdd($$)
|
||||||
{
|
{
|
||||||
my ($d, $attrList) = @_;
|
my ($d, $attrList) = @_;
|
||||||
|
return if(!$defs{$d});
|
||||||
$defs{$d}{INstructAdd} = 1;
|
$defs{$d}{INstructAdd} = 1;
|
||||||
foreach my $c (keys %{$defs{$d}{CONTENT}}) {
|
foreach my $c (keys %{$defs{$d}{CONTENT}}) {
|
||||||
if($defs{$c}{INstructAdd}) {
|
if($defs{$c} && $defs{$c}{INstructAdd}) {
|
||||||
Log 1, "recursive structure definition"
|
Log 1, "recursive structure definition"
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -69,7 +70,7 @@ structAdd($$)
|
|||||||
structAdd($c, $attrList) if($defs{$c} && $defs{$c}{TYPE} eq "structure");
|
structAdd($c, $attrList) if($defs{$c} && $defs{$c}{TYPE} eq "structure");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete $defs{$d}{INstructAdd};
|
delete $defs{$d}{INstructAdd} if($defs{$d});
|
||||||
}
|
}
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
@@ -93,10 +94,8 @@ structure_Define($$)
|
|||||||
foreach my $a (@a) {
|
foreach my $a (@a) {
|
||||||
foreach my $d (devspec2array($a)) {
|
foreach my $d (devspec2array($a)) {
|
||||||
$list{$d} = 1;
|
$list{$d} = 1;
|
||||||
if($init_done) {
|
addToDevAttrList($d, $aList);
|
||||||
addToDevAttrList($d, $aList);
|
structAdd($d, $aList) if($defs{$d} && $defs{$d}{TYPE} eq "structure");
|
||||||
structAdd($d, $aList) if($defs{$d} && $defs{$d}{TYPE} eq "structure");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$hash->{CONTENT} = \%list;
|
$hash->{CONTENT} = \%list;
|
||||||
|
|||||||
Reference in New Issue
Block a user