From 9351729634b52db0e7e241bed7784fbcd5c39fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Fri, 28 Aug 2020 09:05:47 +0800 Subject: [PATCH] fix: Cannot read property 'startsWith' of undefined (#1358) * fix: Cannot read property 'startsWith' of undefined * Update search.js * update * Update search.js --- src/plugins/search/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/search/search.js b/src/plugins/search/search.js index 6a212c016..7cda33071 100644 --- a/src/plugins/search/search.js +++ b/src/plugins/search/search.js @@ -203,7 +203,7 @@ export function init(config, vm) { let namespaceSuffix = ''; // only in auto mode - if (isAuto && config.pathNamespaces) { + if (paths.length && isAuto && config.pathNamespaces) { const path = paths[0]; if (Array.isArray(config.pathNamespaces)) {