Skip to content

Commit 244fe08

Browse files
committed
Update chatwoot.service.ts
fix: message can be undefined
1 parent 3545b80 commit 244fe08

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
@@ -1204,9 +1204,10 @@ export class ChatwootService {
12041204
}
12051205

12061206
private updateChatwootMessageId(message: MessageRaw, chatwootMessageId: string, instance: InstanceDto) {
1207-
if (!chatwootMessageId) {
1207+
if (!chatwootMessageId || !message?.key?.id) {
12081208
return;
12091209
}
1210+
12101211
message.chatwootMessageId = chatwootMessageId;
12111212
this.repository.message.update([message], instance.instanceName, true);
12121213
}

0 commit comments

Comments
 (0)