2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 19:32:42 +00:00

98_update.pm: check for empty statefile

git-svn-id: https://svn.fhem.de/fhem/trunk@12574 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-11-14 05:45:50 +00:00
parent 34a5f5adbc
commit 99cd1b253b

View File

@ -382,7 +382,7 @@ doUpdate($$$$)
if($nChanged) {
for my $f ($attr{global}{configfile}, $attr{global}{statefile}) {
upd_saveConfig($root, $restoreDir, $f) if($f !~ m,(^/|\.\.),);
upd_saveConfig($root, $restoreDir, $f) if($f && $f !~ m,(^/|\.\.),);
}
}
@ -529,7 +529,7 @@ upd_saveConfig($$$)
{
my($root, $restoreDir, $fName) = @_;
return if(!$restoreDir || configDBUsed() || !-r "$root/$fName");
return if(!$fName || !$restoreDir || configDBUsed() || !-r "$root/$fName");
upd_mkDir($root, "$restoreDir/$fName", 1);
Log 1, "saving $fName";
if(!copy("$root/$fName", "$root/$restoreDir/$fName")) {