From 2c1c4aedf8986a28c9fdb79d4094a5a230f15a70 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Tue, 23 Aug 2022 16:59:30 +0530 Subject: [PATCH] fix: handle non inited searcher --- src/components/SearchBar.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/SearchBar.vue b/src/components/SearchBar.vue index 7aec88d5..e4a17621 100644 --- a/src/components/SearchBar.vue +++ b/src/components/SearchBar.vue @@ -287,7 +287,7 @@ export default { }, open() { this.openModal = true; - this.searcher.updateKeywords(); + this.searcher?.updateKeywords(); nextTick(() => { this.$refs.input.focus(); }); @@ -370,6 +370,10 @@ export default { }, {}); }, suggestions() { + if (!this.searcher) { + return []; + } + const suggestions = this.searcher.search(this.inputValue); if (this.limit === -1) { return suggestions;