From b18876e3b481fd75a35e97b62cac787a9add960e Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Fri, 10 Sep 2021 19:31:25 +0000 Subject: [PATCH] 59_Twilight: prevent uninitialized warning w missing ext. weather device git-svn-id: https://svn.fhem.de/fhem/trunk@24945 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/59_Twilight.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fhem/FHEM/59_Twilight.pm b/fhem/FHEM/59_Twilight.pm index 68203c3fb..27ec3218a 100644 --- a/fhem/FHEM/59_Twilight.pm +++ b/fhem/FHEM/59_Twilight.pm @@ -198,7 +198,7 @@ sub Twilight_Change_DEF { my @wd = devspec2array("TYPE=Weather|PROPLANTA"); my ($err, $wreading); ($err, $wreading) = Twilight_disp_ExtWeather($hash, $wd[0]) if $wd[0]; - $weather = $err ? "" : $wd[0] ; + $weather = $err || !defined $wd[0] ? q{} : $wd[0] ; } $newdef = "$hash->{helper}{'.LATITUDE'} $hash->{helper}{'.LONGITUDE'}" if $hash->{helper}{'.LATITUDE'} != AttrVal( 'global', 'latitude', 50.112 ) || $hash->{helper}{'.LONGITUDE'} != AttrVal( 'global', 'longitude', 8.686 ); $newdef .= " $hash->{INDOOR_HORIZON} $weather";