Aleksandar Lazic's patch to handle GetFileFromURL returning nothing

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1767 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert
2012-07-29 13:31:09 +00:00
parent dd5f0babb5
commit 46d0520c70

View File

@@ -121,7 +121,7 @@ sub Weather_RetrieveDataDirectly($)
my $fc = undef;
my $xml = GetFileFromURL("http://www.google.com/ig/api?weather=" . $location . "&hl=" . $lang);
return 0 if($xml eq "");
return 0 if( ! defined $xml || $xml eq "");
foreach my $l (split("<",$xml)) {
#Log 1, "DEBUG WEATHER: line=\"$l\"";
next if($l eq ""); # skip empty lines