From 81ede31423ed8ea52addbd4a21eefd2abd336475 Mon Sep 17 00:00:00 2001 From: Gilles Date: Sat, 7 Jul 2018 02:38:45 +0200 Subject: [PATCH] Fix Cannot read property replace of null --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2766788..786bb13 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,7 @@ function fromUrl (giturl, opts) { project = decodeURIComponent(shortcutMatch[3]) defaultRepresentation = 'shortcut' } else { - if (parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return + if (parsed.host && (parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain)) return if (!gitHostInfo.protocols_re.test(parsed.protocol)) return if (!parsed.path) return var pathmatch = gitHostInfo.pathmatch