2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 23:09:26 +00:00

SVG: avoid exit for wrong data

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

View File

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