Avoid console error
This commit is contained in:
parent
80efd58881
commit
fc06f0cdd1
|
@ -43,11 +43,11 @@
|
||||||
function getSuggestions(input, trie) {
|
function getSuggestions(input, trie) {
|
||||||
// Follow the trie through the provided input
|
// Follow the trie through the provided input
|
||||||
input.split("").forEach((letter) => {
|
input.split("").forEach((letter) => {
|
||||||
trie = trie[letter];
|
|
||||||
|
|
||||||
if (!trie) {
|
if (!trie) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trie = trie[letter];
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!trie) {
|
if (!trie) {
|
||||||
|
|
Loading…
Reference in New Issue