History

Guard against empty WebSocket URLs in WsTransport constructor

macroscopeapp[bot] committed 8 months ago

Commit ac7da4e1 parent 1e6b5891 file · +3 −0Browse files

Unified · Split

apps/web/src/wsTransport.ts+3−0
@@ -37,6 +37,9 @@ export class WsTransport { · 36 unmodified lines
37 37
38 constructor(url?: string) {38 constructor(url?: string) {
39 this.url = url ?? resolveServerWsUrl();39 this.url = url ?? resolveServerWsUrl();
40 if (!this.url) {
41 throw new Error("WebSocket URL is required");
42 }
40 this.connect();43 this.connect();
41 }44 }
42 45