diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index fab43e293..f8d79922c 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -680,7 +680,7 @@ export class BaileysStartupService extends ChannelStartupService { try { const response = await axios.get(this.localProxy?.host); const text = response.data; - const proxyUrls = text.split('\r\n'); + const proxyUrls = text.split('\r\n').filter(Boolean); const rand = Math.floor(Math.random() * Math.floor(proxyUrls.length)); const proxyUrl = 'http://' + proxyUrls[rand]; this.logger.info('Proxy url: ' + proxyUrl);