32_withings.pm: fix for warnings if not connected

git-svn-id: https://svn.fhem.de/fhem/trunk@6959 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2014-11-13 08:59:03 +00:00
parent 99e68f7530
commit a56760e30e

View File

@@ -553,6 +553,9 @@ withings_pollUser($)
$url .= "&userid=$hash->{User}&publickey=$hash->{Key}";
$url .= "&lastupdate=$lastupdate" if( $lastupdate );
my $ret = get($url);
return if( !$ret );
#my $json = JSON->new->utf8(0)->decode($ret);
my $json = ();
$json = JSON->new->utf8->decode(encode('UTF-8', $ret)) if( $ret =~ m/^{.*}$/ );