From 967e301390d877b3aaac8fb957526d44e2ee9ab6 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 25 Apr 2022 22:47:55 +0200 Subject: [PATCH] [editor] Fix: Allow empty description in sorting / filter Signed-off-by: Knut Ahlers --- src/rules.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rules.vue b/src/rules.vue index b293e94..92b07f4 100644 --- a/src/rules.vue +++ b/src/rules.vue @@ -615,8 +615,8 @@ export default { filteredRules() { const rules = [...this.rules] - .filter(rule => !this.filter || rule.description.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase())) - rules.sort((a, b) => a.description.toLocaleLowerCase().localeCompare(b.description.toLocaleLowerCase())) + .filter(rule => !this.filter || rule.description?.toLocaleLowerCase().includes(this.filter?.toLocaleLowerCase())) + rules.sort((a, b) => a.description?.toLocaleLowerCase().localeCompare(b.description?.toLocaleLowerCase())) return rules }, },