Add error check for no Storage Areas found for this server

This commit is contained in:
Isaac Connor 2018-01-29 07:40:37 -08:00
parent 7eaa0180e5
commit c89d4e424e
1 changed files with 3 additions and 0 deletions

View File

@ -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();