From 9d454bdc41aa4c65ca20f652079ef7670bd58690 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 21 Dec 2015 15:29:18 -0500 Subject: [PATCH] Add test for empty storage path --- scripts/ZoneMinder/lib/ZoneMinder/Event.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm index f175a5d34..a7474fbb8 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm @@ -313,6 +313,11 @@ sub delete_files { my $Storage = new ZoneMinder::Storage( $_[0]{StorageId} ); my $storage_path = $Storage->Path(); + if ( ! $storage_path ) { + Fatal("No storage path when deleting fileds for event $_[0]{Id} with storage id $_[0]{StorageId} "); + return; + } + chdir ( $storage_path ); if ( $Config{ZM_USE_DEEP_STORAGE} )