From 6bd20cccc52394209fc3414e56f7ba464a420427 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 3 Mar 2019 13:16:05 +0000 Subject: [PATCH] 98_SVG.pm: do not crash when plotSize is not set (Forum #97977) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18777 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/98_SVG.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FHEM/98_SVG.pm b/FHEM/98_SVG.pm index d547f699e..af20cd8c7 100644 --- a/FHEM/98_SVG.pm +++ b/FHEM/98_SVG.pm @@ -149,7 +149,7 @@ SVG_AttrFn(@) { my ($cmd,$name,$aName,$aVal) = @_; - if($aName eq "captionLeft" && $cmd eq "set") { + if($aName && $aName eq "captionLeft" && $cmd eq "set") { my $dir = (!defined($aVal) || $aVal) ? "left" : "right"; AnalyzeCommand(undef, "attr $name captionPos $dir"); return "attr $name captionLeft converted to attr $name captionPos $dir"; @@ -179,8 +179,9 @@ sub SVG_getplotsize($) { my ($d) = @_; - return $FW_webArgs{plotsize} ? - $FW_webArgs{plotsize} : AttrVal($d,"plotsize",$FW_plotsize); + return $FW_webArgs{plotsize} ? + $FW_webArgs{plotsize} : + AttrVal($d,"plotsize", $FW_plotsize ? $FW_plotsize : "800,400"); } sub