From b154db5aa9c31cb8c90045acb2697053d73048d9 Mon Sep 17 00:00:00 2001 From: Rodrigo Bertoldo de Sousa Martins Date: Fri, 12 Dec 2025 14:10:59 -0300 Subject: [PATCH] TopSapp: fix API show blocked services from client Signed-off-by: Rodrigo Bertoldo de Sousa Martins --- src/bot/handler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bot/handler.js b/src/bot/handler.js index 46072b2..7f9d35b 100644 --- a/src/bot/handler.js +++ b/src/bot/handler.js @@ -3880,8 +3880,11 @@ Digite /help para ver todos os comandos disponíveis! ] ]; - // Adicionar botão para gerar PDF da primeira fatura - if (resultado.faturasPorServico.length > 0 && resultado.faturasPorServico[0].faturas.length > 0) { + // Adicionar botão para gerar PDF da primeira fatura (se houver) + if (resultado.faturasPorServico && + resultado.faturasPorServico.length > 0 && + resultado.faturasPorServico[0].faturas && + resultado.faturasPorServico[0].faturas.length > 0) { const primeiraFatura = resultado.faturasPorServico[0].faturas[0]; keyboard.push([ { text: '📄 Gerar Boleto PDF', callback_data: `boleto_pdf_${primeiraFatura.id}_${location}` }