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
commit d93a826e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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