Skip to content

Commit d93a826

Browse files
Merge pull request #309 from jaison-x/pr
fix: message can be undefined
2 parents 5f1a5d6 + 244fe08 commit d93a826

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/whatsapp/services/chatwoot.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,9 +1222,10 @@ export class ChatwootService {
12221222
}
12231223

12241224
private updateChatwootMessageId(message: MessageRaw, chatwootMessageId: string, instance: InstanceDto) {
1225-
if (!chatwootMessageId) {
1225+
if (!chatwootMessageId || !message?.key?.id) {
12261226
return;
12271227
}
1228+
12281229
message.chatwootMessageId = chatwootMessageId;
12291230
this.repository.message.update([message], instance.instanceName, true);
12301231
}

0 commit comments

Comments
 (0)