Handle stack overflow caused by wanakana.toKana (#615)
This commit is contained in:
parent
6562d0c1e5
commit
713bf29377
@ -312,7 +312,14 @@ class DisplaySearch extends Display {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setQuery(query) {
|
setQuery(query) {
|
||||||
const interpretedQuery = this.isWanakanaEnabled() ? wanakana.toKana(query) : query;
|
let interpretedQuery = query;
|
||||||
|
if (this.isWanakanaEnabled()) {
|
||||||
|
try {
|
||||||
|
interpretedQuery = wanakana.toKana(query);
|
||||||
|
} catch (e) {
|
||||||
|
// NOP
|
||||||
|
}
|
||||||
|
}
|
||||||
this.query.value = interpretedQuery;
|
this.query.value = interpretedQuery;
|
||||||
this.queryParser.setText(interpretedQuery);
|
this.queryParser.setText(interpretedQuery);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user