Skip to content

Commit 2e09afc

Browse files
committed
fix: Cannot read property 'startsWith' of undefined
1 parent b353ace commit 2e09afc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/search/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export function init(config, vm) {
208208

209209
if (Array.isArray(config.pathNamespaces)) {
210210
namespaceSuffix =
211-
config.pathNamespaces.find(prefix => path.startsWith(prefix)) ||
211+
config.pathNamespaces.find(prefix => path && path.startsWith(prefix)) ||
212212
namespaceSuffix;
213213
} else if (config.pathNamespaces instanceof RegExp) {
214214
const matches = path.match(config.pathNamespaces);

0 commit comments

Comments
 (0)