*Only run loop while this._activeRelay is not set

This commit is contained in:
Derrick Hammer 2023-02-01 04:41:45 -05:00
parent 21fb795488
commit cc7c7c8edf
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ export default class HyperswarmWeb extends EventEmitter {
this._activeRelay.on("close", () => {
this._activeRelay = undefined;
});
} while (relays.length > 0);
} while (relays.length > 0 && !this._activeRelay);
if (!this._activeRelay) {
throw new Error("Failed to find an available relay");