From b750da3f9da42922936b5775acc79be532c06b6d Mon Sep 17 00:00:00 2001 From: Metsjeesus Date: Mon, 17 Apr 2017 22:48:28 +0300 Subject: [PATCH] Fix to helper.expandhome to correctly resolve "" and undefined --- src/helper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helper.js b/src/helper.js index 830b91c9..552b11ad 100644 --- a/src/helper.js +++ b/src/helper.js @@ -101,6 +101,9 @@ function ip2hex(address) { } function expandHome(shortenedPath) { + if (!shortenedPath) { + return ""; + } var home; if (os.homedir) { @@ -112,7 +115,6 @@ function expandHome(shortenedPath) { } home = home.replace("$", "$$$$"); - return path.resolve(shortenedPath.replace(/^~($|\/|\\)/, home + "$1")); }