Fix to helper.expandhome to correctly resolve "" and undefined

This commit is contained in:
Metsjeesus 2017-04-17 22:48:28 +03:00
parent fb04f9fcbf
commit b750da3f9d

View File

@ -101,6 +101,9 @@ function ip2hex(address) {
} }
function expandHome(shortenedPath) { function expandHome(shortenedPath) {
if (!shortenedPath) {
return "";
}
var home; var home;
if (os.homedir) { if (os.homedir) {
@ -112,7 +115,6 @@ function expandHome(shortenedPath) {
} }
home = home.replace("$", "$$$$"); home = home.replace("$", "$$$$");
return path.resolve(shortenedPath.replace(/^~($|\/|\\)/, home + "$1")); return path.resolve(shortenedPath.replace(/^~($|\/|\\)/, home + "$1"));
} }