From fa63a3eb6fc01e903ce42bf70f07ee41fa841ed6 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Fri, 26 Aug 2022 13:57:05 -0300 Subject: [PATCH] fix(kb.gbapp): Skips blank answers lines. --- packages/kb.gbapp/services/KBService.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/kb.gbapp/services/KBService.ts b/packages/kb.gbapp/services/KBService.ts index b5b0b35a..93433784 100644 --- a/packages/kb.gbapp/services/KBService.ts +++ b/packages/kb.gbapp/services/KBService.ts @@ -453,10 +453,11 @@ export class KBService implements IGBKBService { const subjectsText = line._cells[0].text; const from = line._cells[1].text; const to = line._cells[2].text; - const question = line._cells[3].text; - let answer = line._cells[4].text; + const question = line._cells[3].text.trim(); + let answer = line._cells[4].text.trim(); - if (!(subjectsText === 'subjects' && from === 'from') && answer !== null && question !== null) { + if (!(subjectsText === 'subjects' && from === 'from') && answer !== null && question !== null && + answer !== '' && question !== '') { let format = '.txt'; // Extracts answer from external media if any. @@ -508,7 +509,7 @@ export class KBService implements IGBKBService { // Skips blank answers. - if (answer && answer.length < 1) { + if (answer && answer.trim() === '') { return false; }