Test for existence of file before adding it to zip. Apparently our glob can return the snapshot.jpg string even if it doesn't exist. This is a workaround to Archive::Zip not testing for failure and crashing. Fixes #3313

This commit is contained in:
Isaac Connor 2021-07-08 11:03:56 -04:00
parent 1766bbdfcd
commit 14047bc820
1 changed files with 4 additions and 0 deletions

View File

@ -548,6 +548,10 @@ sub uploadArchFile {
my $status = &AZ_OK; my $status = &AZ_OK;
foreach my $imageFile ( @archImageFiles ) { foreach my $imageFile ( @archImageFiles ) {
if (! -e $imageFile) {
Debug("Not adding $imageFile because it doesn't exist");
next;
}
Debug("Adding $imageFile"); Debug("Adding $imageFile");
my $member = $zip->addFile($imageFile); my $member = $zip->addFile($imageFile);
if ( !$member ) { if ( !$member ) {