Compare commits

...

2 Commits

Author SHA1 Message Date
Derrick Hammer 6a843447b1
*Update dist 2023-02-01 04:42:29 -05:00
Derrick Hammer cc7c7c8edf
*Only run loop while this._activeRelay is not set 2023-02-01 04:41:45 -05:00
2 changed files with 2 additions and 2 deletions

2
dist/index.js vendored
View File

@ -53,7 +53,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");
}

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");