don't move event if there are no files. Add some more debug

pull/2098/merge
Isaac Connor 2018-05-03 09:30:06 -07:00
parent 29140a3012
commit 095f4614da
1 changed files with 9 additions and 3 deletions

View File

@ -630,6 +630,10 @@ Debug("Files to move @files");
return $error;
}
my @files = glob("$OldPath/*");
if ( ! @files ) {
$ZoneMinder::Database::dbh->commit();
return "No files to move.";
}
for my $file (@files) {
next if $file =~ /^\./;
@ -659,8 +663,10 @@ Debug("Files to move @files");
$ZoneMinder::Database::dbh->commit();
return $error;
}
Debug("Committing");
$ZoneMinder::Database::dbh->commit();
$self->delete_files( $OldStorage );
Debug("Done deleting files, returning");
return $error;
} # end sub MoveTo