diff --git a/backend/src/chat/chat.gateway.ts b/backend/src/chat/chat.gateway.ts index b9bd7610..8d78484d 100644 --- a/backend/src/chat/chat.gateway.ts +++ b/backend/src/chat/chat.gateway.ts @@ -65,6 +65,10 @@ export class ChatGateway { if (MutedUsers.some((user) => user.id === data.userId)) { return; } + if (data.content.length < 1) { + this.logger.error('no content in message'); + return; + } // Save message to the database await this.chatService.createMessage(data);