Only update storage DiskSpace if assigned an area

This commit is contained in:
Isaac Connor
2025-10-17 08:17:16 -04:00
parent 0b27142c1b
commit 48ae1c5f28

View File

@@ -419,7 +419,7 @@ sub delete {
$ZoneMinder::Database::dbh->commit() if ! $in_transaction;
my $storage = $event->Storage();
if ($event->DiskSpace()) {
if ($event->DiskSpace() and $storage->Id()) {
$storage->lock_and_load();
$storage->save({DiskSpace=>$storage->DiskSpace()-$event->DiskSpace()});
}