Only update event StorageId when the new StorageId has a value

This commit is contained in:
Isaac Connor 2021-04-19 17:53:08 -04:00
parent 7485735e9c
commit ed58447c4d
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ MAIN: while( $loop ) {
} else {
my $full_path = join('/', $Storage->Path(), $day_dir, $event_path);
# Check storage id
if ( !$Event->Storage()->Id() ) {
if ( $Storage->Id() and !$Event->Storage()->Id() ) {
Info("Correcting StorageId for event $$Event{Id} from $$Event{StorageId} $$Event{Path} to $$Storage{Id} $full_path");
$Event->save({ StorageId=>$Storage->Id() });
$Event->Path(undef);