Merge pull request #1 from JrStarkmidia/codex/localizar-uso-de-applyformatting-e-proteger-entrada

Corrige erro em applyFormatting com valores não estruturados

Esta correção adiciona verificação de tipo e valor falsy antes de aplicar o processamento de texto.

Correção baseada em:
EvolutionAPI#1624
This commit is contained in:
JrStarkmidia 2025-06-26 20:08:35 -03:00 committed by GitHub
commit 14474ede62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -197,6 +197,9 @@ export class TypebotService extends BaseChatbotService<TypebotModel, any> {
* Apply rich text formatting for TypeBot messages
*/
private applyFormatting(element: any): string {
if (typeof element === 'string') return element;
if (!element) return '';
let text = '';
if (element.text) {