fhem.pl: Do not regexp-check undef in ReadingsNum (Foum #70496)

git-svn-id: https://svn.fhem.de/fhem/trunk@13983 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2017-04-13 19:04:11 +00:00
parent 3827f4271d
commit 3457779eae

View File

@@ -3974,6 +3974,7 @@ ReadingsNum($$$;$)
{
my ($d,$n,$default,$round) = @_;
my $val = ReadingsVal($d,$n,$default);
return undef if(!defined($val));
$val = ($val =~ /(-?\d+(\.\d+)?)/ ? $1 : "");
$val = round($val,$round) if($round);
return $val;