From 4e6880616f7d4a914cab44b11eb0559b95717f9b Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 13 Apr 2017 19:04:11 +0000 Subject: [PATCH] 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 --- fhem/fhem.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 575c7c371..0772743ee 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -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;