mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
Fix to helper.expandhome to correctly resolve "" and undefined
This commit is contained in:
parent
fb04f9fcbf
commit
b750da3f9d
1 changed files with 3 additions and 1 deletions
|
@ -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"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue