WebSockets: fix node+addr hash when addr is undefined

This commit is contained in:
Luciano Iam 2020-04-12 14:37:44 +02:00 committed by Robin Gareus
parent 3fd7be9aba
commit de7b76e77d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -33,7 +33,7 @@ export const Node = Object.freeze({
export function nodeAddressHash(node, addr) {
return [node].concat(addr).join('_');
return [node].concat(addr || []).join('_');
}
@ -44,7 +44,7 @@ export class MessageChannel {
this.host = host;
}
open () {
async open () {
return new Promise((resolve, reject) => {
this.socket = new WebSocket(`ws://${this.host}`);