only update DiskSpace if new DiskSpace is defined

pull/2065/head
Isaac Connor 2018-04-19 14:22:19 -04:00
parent 505e726636
commit 2516846176
1 changed files with 7 additions and 1 deletions

View File

@ -340,7 +340,13 @@ sub checkFilter {
$Event->lock_and_load();
my $old_diskspace = $$Event{DiskSpace};
if ( $old_diskspace != $Event->DiskSpace(undef) ) {
my $new_diskspace = $Event->DiskSpace(undef);
if (
( (!defined $old_diskspace) and defined $new_diskspace)
or
( (defined $old_diskspace) and (defined $new_diskspace) and ( $old_diskspace != $Event->DiskSpace(undef) ) )
) {
$Event->save();
}
$ZoneMinder::Database::dbh->commit();