Fix incorrect message counter

e0e60a1d007edb870c64a69c7cc8a0b1fa1f71c0

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Showing whitespace changes
src/endpoints/chats.js+1 -1
@@ -615,7 +615,7 @@ router.post('/search', jsonParser, function (request, response) {
615 const data = fs.readFileSync(chatFile.path, 'utf8');615 const data = fs.readFileSync(chatFile.path, 'utf8');
616 const messages = data.split('\n')616 const messages = data.split('\n')
617 .map(line => { try { return JSON.parse(line); } catch (_) { return null; } })617 .map(line => { try { return JSON.parse(line); } catch (_) { return null; } })
618 .filter(x => x);618 .filter(x => x && typeof x.mes === 'string');
619619
620 if (messages.length === 0) {620 if (messages.length === 0) {
621 continue;621 continue;