Merge pull request #309 from jaison-x/pr

fix: message can be undefined
This commit is contained in:
Davidson Gomes
2023-12-19 18:59:59 -03:00
committed by GitHub

View File

@@ -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);
}