js-mdict
js-mdict copied to clipboard
mdict.js _findList 返回值可能是 undefined,后续取值会报错
_findList(word) {
const findListInternal = (compareFn) => {
const sfunc = this._stripKey();
const kbid = this._reduceWordKeyBlock(word, sfunc, compareFn);
// not found
if (kbid < 0) {
return undefined;
}
return { sfunc, kbid, list: this._decodeKeyBlockByKBID(kbid) };
};
let list;
if (this._isKeyCaseSensitive()) {
list = findListInternal(common.normalUpperCaseWordCompare);
} else {
list = findListInternal(common.normalUpperCaseWordCompare);
if (list === undefined) {
list = findListInternal(common.wordCompare);
}
}
return list;
}
findListInternal 会返回 undefined,后续操作报错,比如:this._findList(phrase).list
感谢反馈,我会尽快修复该问题
本问题已经修复。