From a12030fda75355d2157fcc48e630c686174d90bf Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 26 Jan 2018 12:54:54 -0800 Subject: [PATCH] Handle no storageareas found --- scripts/zmaudit.pl.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index 3948841d6..4f30b5b1a 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -180,6 +180,9 @@ MAIN: while( $loop ) { Info("Auditing Storage Area $Storage_Areas[0]{Id} $Storage_Areas[0]{Name} at $Storage_Areas[0]{Path}"); } elsif ( $Config{ZM_SERVER_ID} ) { @Storage_Areas = ZoneMinder::Storage->find( ServerId => $Config{ZM_SERVER_ID} ); + if ( ! @Storage_Areas ) { + Fatal("No Storage Area found with ServerId =" . $Config{ZM_SERVER_ID}); + } Info("Auditing All Storage Areas on Server " . $Storage_Areas[0]->Server()->Name()); } else { @Storage_Areas = ZoneMinder::Storage->find();