Skip to content

Commit

Permalink
Merge pull request #309 from jaison-x/pr
Browse files Browse the repository at this point in the history
fix: message can be undefined
  • Loading branch information
DavidsonGomes authored Dec 19, 2023
2 parents 5f1a5d6 + 244fe08 commit d93a826
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/whatsapp/services/chatwoot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d93a826

Please sign in to comment.