use find_one instead of new. We seem to be comparing against unfound event objects

This commit is contained in:
Isaac Connor 2018-11-29 10:09:49 -05:00
parent c0a9fae01f
commit 1a85e282e2
1 changed files with 2 additions and 2 deletions

View File

@ -592,8 +592,8 @@ EVENT: while ( my ( $db_event, $age ) = each( %$db_events ) ) {
} # end if exists in filesystem } # end if exists in filesystem
} else { } else {
Debug("Found fs event for id $db_event, $age seconds old at " . $$fs_events{$db_event}->Path()); Debug("Found fs event for id $db_event, $age seconds old at " . $$fs_events{$db_event}->Path());
my $Event = new ZoneMinder::Event( $db_event ); my $Event = ZoneMinder::Event->find_one( Id=>$db_event );
if ( ! $Event->check_for_in_filesystem() ) { if ( $Event and ! $Event->check_for_in_filesystem() ) {
Warning("Not found at " . $Event->Path() . ' was found at ' . $$fs_events{$db_event}->Path() ); Warning("Not found at " . $Event->Path() . ' was found at ' . $$fs_events{$db_event}->Path() );
Warning($Event->to_string()); Warning($Event->to_string());
Warning($$fs_events{$db_event}->to_string()); Warning($$fs_events{$db_event}->to_string());