From e98e2c8425013448d2b446b3ff81ca75041bff74 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 14 Apr 2017 15:01:35 +0000 Subject: [PATCH] fhem.pl: add undef check to AttrNum (Forum #70496) git-svn-id: https://svn.fhem.de/fhem/trunk@13989 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 0772743ee..6fea658bd 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -4042,6 +4042,7 @@ AttrNum($$$;$) { my ($d,$n,$default,$round) = @_; my $val = AttrVal($d,$n,$default); + return undef if(!defined($val)); $val = ($val =~ /(-?\d+(\.\d+)?)/ ? $1 : ""); $val = round($val,$round) if($round); return $val;