fix: handle null enriched comment in comments service
- Added a null check for `enrichedComment` to prevent processing invalid data and potential runtime errors.
This commit is contained in:
@@ -33,6 +33,7 @@ export class CommentsService {
|
||||
|
||||
// Récupérer le commentaire avec les infos utilisateur pour le WebSocket
|
||||
const enrichedComment = await this.findOneEnriched(comment.id, userId);
|
||||
if (!enrichedComment) return null;
|
||||
|
||||
// Notifier les autres utilisateurs sur ce contenu (room de contenu)
|
||||
this.eventsGateway.sendToContent(contentId, "new_comment", enrichedComment);
|
||||
|
||||
Reference in New Issue
Block a user