Skip to content

Commit df841ae

Browse files
committed
fix: adjusts in fetch instances
1 parent d4372a0 commit df841ae

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/whatsapp/services/monitor.service.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,14 @@ export class WAMonitoringService {
108108
}
109109

110110
const findIntegration = await this.waInstances[key].findIntegration();
111-
const integration = {
112-
...findIntegration,
113-
webhook_wa_business: `${urlServer}/webhook/whatsapp/${encodeURIComponent(key)}`,
114-
};
111+
112+
let integration: any;
113+
if (findIntegration) {
114+
integration = {
115+
...findIntegration,
116+
webhook_wa_business: `${urlServer}/webhook/whatsapp/${encodeURIComponent(key)}`,
117+
};
118+
}
115119

116120
if (value.connectionStatus.state === 'open') {
117121
this.logger.verbose('instance: ' + key + ' - connectionStatus: open');

0 commit comments

Comments
 (0)