diff --git a/src/whatsapp/services/chatwoot.service.ts b/src/whatsapp/services/chatwoot.service.ts index ec8079f6c..ccd01347d 100644 --- a/src/whatsapp/services/chatwoot.service.ts +++ b/src/whatsapp/services/chatwoot.service.ts @@ -1222,9 +1222,10 @@ export class ChatwootService { } private updateChatwootMessageId(message: MessageRaw, chatwootMessageId: string, instance: InstanceDto) { - if (!chatwootMessageId) { + if (!chatwootMessageId || !message?.key?.id) { return; } + message.chatwootMessageId = chatwootMessageId; this.repository.message.update([message], instance.instanceName, true); }