prevent infinite loop if source length is 0
This commit is contained in:
parent
a02cf28c57
commit
3fa8b8e186
@ -324,7 +324,7 @@ class Backend {
|
||||
{},
|
||||
options
|
||||
);
|
||||
if (definitions.length > 0) {
|
||||
if (definitions.length > 0 && sourceLength > 0) {
|
||||
dictTermsSort(definitions);
|
||||
const {expression, reading} = definitions[0];
|
||||
const source = text.substring(0, sourceLength);
|
||||
|
Loading…
Reference in New Issue
Block a user