From 9de8b26499a2335da2c5baaf9e91366451bc8155 Mon Sep 17 00:00:00 2001 From: justme1968 Date: Wed, 15 May 2013 21:54:07 +0000 Subject: [PATCH] fixed uninitialized value warning git-svn-id: https://svn.fhem.de/fhem/trunk@3186 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/30_HUEBridge.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/30_HUEBridge.pm b/fhem/FHEM/30_HUEBridge.pm index cf5c19780..0667ffb90 100644 --- a/fhem/FHEM/30_HUEBridge.pm +++ b/fhem/FHEM/30_HUEBridge.pm @@ -207,8 +207,10 @@ HUEBridge_GetUpdate($) if( defined( $result->{swupdate} ) ) { my $txt = $result->{swupdate}->{text}; readingsSingleUpdate($hash, "swupdate", $txt, defined($hash->{LOCAL} ? 0 : 1)) if( $txt && $txt ne ReadingsVal($name,"swupdate","") ); - $hash->{STATE} = "update done" if( $result->{swupdate}->{updatestate} == 0 && $hash->{updatestate} >= 2 ); - $hash->{STATE} = "update failed" if( $result->{swupdate}->{updatestate} == 2 && $hash->{updatestate} == 3 ); + if( defined($hash->{updatestate}) ){ + $hash->{STATE} = "update done" if( $result->{swupdate}->{updatestate} == 0 && $hash->{updatestate} >= 2 ); + $hash->{STATE} = "update failed" if( $result->{swupdate}->{updatestate} == 2 && $hash->{updatestate} == 3 ); + } $hash->{updatestate} = $result->{swupdate}->{updatestate}; } elsif ( defined( $hash->{swupdate} ) ) {