Skip to content

Commit 14474ed

Browse files
authored
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: #1624
2 parents 3960624 + f5f423e commit 14474ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/api/integrations/chatbot/typebot/services/typebot.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ export class TypebotService extends BaseChatbotService<TypebotModel, any> {
197197
* Apply rich text formatting for TypeBot messages
198198
*/
199199
private applyFormatting(element: any): string {
200+
if (typeof element === 'string') return element;
201+
if (!element) return '';
202+
200203
let text = '';
201204

202205
if (element.text) {

0 commit comments

Comments
 (0)