diff --git a/dist/index.js b/dist/index.js index 9595ecf..e3fc484 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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"); }