If failed to delete from Frames or Stats, return instead of deleting the event.
This commit is contained in:
parent
a271f1776d
commit
cf4ac74d02
|
@ -357,6 +357,9 @@ sub delete {
|
|||
my $res = $sth->execute( $event->{Id} )
|
||||
or Error( "Can't execute '$sql': ".$sth->errstr() );
|
||||
$sth->finish();
|
||||
if ( $ZoneMinder::Database::dbh->errstr() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM Stats WHERE EventId=?';
|
||||
$sth = $ZoneMinder::Database::dbh->prepare_cached( $sql )
|
||||
|
@ -364,6 +367,9 @@ sub delete {
|
|||
$res = $sth->execute( $event->{Id} )
|
||||
or Error( "Can't execute '$sql': ".$sth->errstr() );
|
||||
$sth->finish();
|
||||
if ( $ZoneMinder::Database::dbh->errstr() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->delete_files( );
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue