fix(kb.gbapp): Skips blank answers lines.

This commit is contained in:
Rodrigo Rodriguez 2022-08-26 13:57:05 -03:00
parent 4922c448fa
commit fa63a3eb6f

View file

@ -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;
}