fix: only set socket if passed
This commit is contained in:
parent
4f3af7fdb4
commit
a7b3129426
|
@ -11,8 +11,10 @@ export abstract class BasePeer implements Peer {
|
|||
constructor({ socket, uris = [] }: PeerConstructorOptions) {
|
||||
this.connectionUris = uris.map((uri) => new URL(uri.toString()));
|
||||
this.challenge = new Uint8Array();
|
||||
if (socket) {
|
||||
this._socket = socket;
|
||||
}
|
||||
}
|
||||
|
||||
private _id?: NodeId;
|
||||
|
||||
|
|
Loading…
Reference in New Issue