SVG: avoid exit for wrong data

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4081 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-10-21 06:37:07 +00:00
parent 88410ea6d4
commit 338be25e0f

View File

@ -1033,7 +1033,6 @@ SVG_render($$$$$$$$$)
} else { } else {
($d, $v) = split(" ", $l); ($d, $v) = split(" ", $l);
$d = ($tmul ? int((SVG_time_to_sec($d)-$fromsec)*$tmul) : $d); $d = ($tmul ? int((SVG_time_to_sec($d)-$fromsec)*$tmul) : $d);
if($ld ne $d || $lv ne $v) { # Saves a lot on year zoomlevel if($ld ne $d || $lv ne $v) { # Saves a lot on year zoomlevel
$ld = $d; $lv = $v; $ld = $d; $lv = $v;
@ -1047,11 +1046,11 @@ SVG_render($$$$$$$$$)
} }
$dxp = $hdx[0]; $dxp = $hdx[0];
if($dxp && int(@{$dxp}) < 2 && !$tosec) { # not enough data and no range... if(($dxp && int(@{$dxp}) < 2 && !$tosec) || # not enough data and no range...
(!$tmul && !$dxp)) {
SVG_pO "</svg>"; SVG_pO "</svg>";
return $SVG_RET; return $SVG_RET;
} }
if(!$tmul) { # recompute the x data if no range sepcified if(!$tmul) { # recompute the x data if no range sepcified
$fromsec = SVG_time_to_sec($dxp->[0]) if(!$fromsec); $fromsec = SVG_time_to_sec($dxp->[0]) if(!$fromsec);
$tosec = SVG_time_to_sec($dxp->[int(@{$dxp})-1]) if(!$tosec); $tosec = SVG_time_to_sec($dxp->[int(@{$dxp})-1]) if(!$tosec);