diff --git a/apps/api/src/app/activities/activities.controller.ts b/apps/api/src/app/activities/activities.controller.ts index 21adf7c19..e0ca246c2 100644 --- a/apps/api/src/app/activities/activities.controller.ts +++ b/apps/api/src/app/activities/activities.controller.ts @@ -301,7 +301,7 @@ export class ActivitiesController { id }); - if (!originalActivity || originalActivity.userId !== this.request.user.id) { + if (originalActivity?.userId !== this.request.user.id) { throw new HttpException( getReasonPhrase(StatusCodes.FORBIDDEN), StatusCodes.FORBIDDEN diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 7040ca104..6d5f932e0 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -573,7 +573,7 @@ export class ImportService { // If there is no asset profile or if the asset profile belongs to a // different user, then reuse the custom asset profile of the user or // create a new asset profile - if (!existingAssetProfile || existingAssetProfile.userId !== user.id) { + if (existingAssetProfile?.userId !== user.id) { // Check if the user has a custom asset profile with the same name. // Skip asset profiles with a legacy free-text symbol as they would // fail the symbol validation on a future import.