From aaa6c5cccb65a68612e07cb1bfeb82d515bf2afa Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 16 Jan 2018 14:01:26 -0500 Subject: [PATCH] Only delete files if no error --- scripts/ZoneMinder/lib/ZoneMinder/Event.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm index 134cfa794..c01294f8c 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Event.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Event.pm @@ -483,7 +483,9 @@ sub MoveTo { $$self{Storage} = $NewStorage; $error .= $self->save(); } - $self->delete_files( $OldStorage ); + if ( ! $error ) { + $self->delete_files( $OldStorage ); + } return $error; } # end sub MoveTo