Two minor fixes on be (#168)

This commit is contained in:
Charles Bochet
2023-05-31 18:33:26 +02:00
committed by GitHub
parent 723ea462e8
commit e3402cc753
6 changed files with 185 additions and 140 deletions

View File

@ -52,7 +52,7 @@ export class CreateOneCommentThreadGuard implements CanActivate {
where: { id: target.commentableId },
});
if (targetEntity.workspaceId !== workspaceId) {
if (!targetEntity || targetEntity.workspaceId !== workspaceId) {
throw new HttpException(
{ reason: 'CommentThreadTarget not found' },
HttpStatus.NOT_FOUND,