From dace7ad06c5b5d6c81ef88e53c2103033449cd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 3 Jan 2021 12:56:16 +0300 Subject: [PATCH] closed #1716 Fixed: JS exception in the AkauntingSearch component --- resources/assets/js/components/AkauntingSearch.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/components/AkauntingSearch.vue b/resources/assets/js/components/AkauntingSearch.vue index 39e05705e..0b5c7f835 100644 --- a/resources/assets/js/components/AkauntingSearch.vue +++ b/resources/assets/js/components/AkauntingSearch.vue @@ -463,7 +463,9 @@ export default { let cookie = Cookies.get('search-string'); - cookie = JSON.parse(cookie)[path]; + if (cookie != undefined) { + cookie = JSON.parse(cookie)[path]; + } if (this.value) { let search_string = this.value.split(' '); @@ -486,7 +488,7 @@ export default { } }, this); - if (!value && cookie[_filter.key]) { + if (!value && (cookie != undefined && cookie[_filter.key])) { value = cookie[_filter.key].value; } @@ -503,7 +505,7 @@ export default { } }, this); - if (cookie[_filter.key]) { + if (cookie != undefined && cookie[_filter.key]) { this.selected_values.push(cookie[_filter.key]); } }