2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

fix: prevent e is not iterable

This commit is contained in:
18alantom 2022-08-23 17:41:50 +05:30
parent 2c1c4aedf8
commit b7810ee25e

View File

@ -523,7 +523,12 @@ export class Search {
keys.sort((a, b) => parseFloat(b) - parseFloat(a));
const array: SearchItems = [];
for (const key of keys) {
this._pushDocSearchItems(groupedKeywords[key], array, input);
const keywords = groupedKeywords[key];
if (!keywords?.length) {
continue;
}
this._pushDocSearchItems(keywords, array, input);
if (key === '0') {
this._pushNonDocSearchItems(array, input);
}