diff --git a/src/controllers/DelegateController.ts b/src/controllers/DelegateController.ts index b0c2260..9978db6 100644 --- a/src/controllers/DelegateController.ts +++ b/src/controllers/DelegateController.ts @@ -252,9 +252,14 @@ export default class DelegateController { let proposedVersion: any = res.locals.organization.proposedVersion const publishedVersion: any = res.locals.organization.publishedVersion if ( - Utils.isStrUsable(proposedVersion, 'thumbnail.location') && - Utils.isStrUsable(publishedVersion, 'thumbnail.location') && - publishedVersion.thumbnail.location !== proposedVersion.thumbnail.location + Utils.isStrUsable(proposedVersion, 'thumbnail.location') && + ( + ( + Utils.isStrUsable(publishedVersion, 'thumbnail.location') && + publishedVersion.thumbnail.location !== proposedVersion.thumbnail.location + ) || + !Utils.isStrUsable(publishedVersion, 'thumbnail.location') + ) ) { MediaService.delete(proposedVersion.thumbnail.key, 'thumbnailUpdated') } @@ -280,9 +285,14 @@ export default class DelegateController { let proposedVersion: any = res.locals.organization.proposedVersion const publishedVersion: any = res.locals.organization.publishedVersion if ( - Utils.isStrUsable(proposedVersion, 'cover.location') && - Utils.isStrUsable(publishedVersion, 'cover.location') && - publishedVersion.cover.location !== proposedVersion.cover.location + Utils.isStrUsable(proposedVersion, 'cover.location') && + ( + ( + Utils.isStrUsable(publishedVersion, 'cover.location') && + publishedVersion.cover.location !== proposedVersion.cover.location + ) || + !Utils.isStrUsable(publishedVersion, 'cover.location') + ) ) { MediaService.delete(proposedVersion.cover.key, 'coverUpdated') }