30_HUEBridge.pm: add some checks

git-svn-id: https://svn.fhem.de/fhem/trunk@25570 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2022-01-27 16:05:06 +00:00
parent c16820191e
commit 24b27c9912

View File

@@ -1277,9 +1277,13 @@ HUEBridge_V2IdOfV1Id($$$)
{
my ($hash, $type, $id) = @_;
my $name = $hash->{NAME};
return "undef" if( !$id );
return "undef" if( !$type );
return "undef" if( !$hash->{has_v2_api} );
foreach my $entry ( values %{$hash->{helper}{resource}{by_id}} ) {
next if( !$entry->{id_v1} );
next if( !$entry->{type} );
next if( $entry->{id_v1} ne $id );
next if( $entry->{type} ne $type );