2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

fhem.pl: Do not regexp-check undef in ReadingsNum (Forum #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 f58034675b
commit 4e6880616f

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;