2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 08:11:44 +00:00

92_FileLog/98_SVG: avoid crash when input file is non-existent (compressed NTP loopstats)

git-svn-id: https://svn.fhem.de/fhem/trunk@8457 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-04-20 14:27:10 +00:00
parent e95f79954a
commit c2e7150019
2 changed files with 3 additions and 3 deletions

View File

@ -923,6 +923,7 @@ FileLog_sampleDataFn($$$$$)
{
my ($flName, $flog, $max, $conf, $wName) = @_;
my $desc = "Input:Column,Regexp,DefaultValue,Function";
my @htmlArr;
my $fName = $defs{$flName}{currentlogfile};
my $reformatFn = AttrVal($flName, "reformatFn", "");
@ -930,7 +931,7 @@ FileLog_sampleDataFn($$$$$)
if(!$fh) {
$fName = "<undefined>" if(!defined($fName));
Log3 $wName, 1, "FileLog get sample data: $fName: $!";
return ($desc, undef, "");
return ($desc, \@htmlArr, "");
}
$fh->seek(0, 2); # Go to the end
my $sz = $fh->tell;
@ -961,7 +962,6 @@ FileLog_sampleDataFn($$$$$)
FileLog_addTics($conf->{y2tics}, \%tickh);
$colnums = join(",", sort keys %tickh).",$colnums" if(%tickh);
my @htmlArr;
for(my $r=0; $r < $max; $r++) {
my @f = split(":", ($flog->[$r] ? $flog->[$r] : ":::"), 4);
my $ret = "";

View File

@ -381,7 +381,7 @@ SVG_PEdit($$$$)
&{$fn}($src, \@argArr, $lmax,\%conf, $FW_wname);
use strict "refs";
$desc = $ldesc;
push @paramHtml, @{$paramHtml};
push @paramHtml, @{$paramHtml} if($paramHtml);
map { push @exampleHtml, $example } (0..$lmax-1);
} else {