From 237a9e2f8a1b7267c55800931bdfd49c83cf9160 Mon Sep 17 00:00:00 2001 From: spalger Date: Mon, 28 Mar 2016 13:40:56 -0700 Subject: [PATCH] [chrome/nav] be less defensive, fail fast --- src/ui/public/chrome/api/nav.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/public/chrome/api/nav.js b/src/ui/public/chrome/api/nav.js index e39b179e4b7c..cd770fec13a0 100644 --- a/src/ui/public/chrome/api/nav.js +++ b/src/ui/public/chrome/api/nav.js @@ -46,7 +46,7 @@ export default function (chrome, internals) { function getAppId(url) { const pathname = parse(url).pathname; const pathnameWithoutBasepath = pathname.slice(chrome.getBasePath().length); - const match = String(pathnameWithoutBasepath).match(/^\/app\/([^\/]+)(?:\/|\?|#|$)/); + const match = pathnameWithoutBasepath.match(/^\/app\/([^\/]+)(?:\/|\?|#|$)/); if (match) return match[1]; }