1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #2610 from node-red-hitachi/fix-charAt-error-on-undefined

Fix char at error on undefined when opening websocket-listner
This commit is contained in:
Nick O'Leary 2020-06-12 08:49:34 +01:00 committed by GitHub
commit b5800205c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,10 +148,12 @@
if (root.slice(-1) != "/") {
root = root+"/";
}
if (this.path.charAt(0) == "/") {
root += this.path.slice(1);
} else {
root += this.path;
if (this.path) {
if (this.path.charAt(0) == "/") {
root += this.path.slice(1);
} else {
root += this.path;
}
}
return root;
},