From 6d363ec9ffd6b27e1c77e5aab853471c6883c7bd Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 16 Apr 2023 01:46:55 +0530 Subject: [PATCH] fix(search): fix errors on empty titles --- src/client/theme-default/components/VPLocalSearchBox.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue index ab180c6b..316df0d0 100644 --- a/src/client/theme-default/components/VPLocalSearchBox.vue +++ b/src/client/theme-default/components/VPLocalSearchBox.vue @@ -158,7 +158,9 @@ debouncedWatch( title = title.replace(reg, `$&`) } if (match.includes('titles')) { - titles = titles.map((t) => t.replace(reg, `$&`)) + titles = titles.flatMap((t) => + t ? [t.replace(reg, `$&`)] : [] + ) } if (showDetailedListValue && match.includes('text')) { text = text.replace(reg, `$&`)