diff --git a/src/whatsapp/services/monitor.service.ts b/src/whatsapp/services/monitor.service.ts index c46a88be..a2899d7c 100644 --- a/src/whatsapp/services/monitor.service.ts +++ b/src/whatsapp/services/monitor.service.ts @@ -108,10 +108,14 @@ export class WAMonitoringService { } const findIntegration = await this.waInstances[key].findIntegration(); - const integration = { - ...findIntegration, - webhook_wa_business: `${urlServer}/webhook/whatsapp/${encodeURIComponent(key)}`, - }; + + let integration: any; + if (findIntegration) { + integration = { + ...findIntegration, + webhook_wa_business: `${urlServer}/webhook/whatsapp/${encodeURIComponent(key)}`, + }; + } if (value.connectionStatus.state === 'open') { this.logger.verbose('instance: ' + key + ' - connectionStatus: open');