mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 19:35:28 +00:00
fix(relayManager): robust check for window.location in getTestRelayOverrides
- Fixes a unit test regression where `getTestRelayOverrides` crashed in Node.js environments (where `window` exists but `window.location` is undefined). - Updated the check to explicitly verify `window.location` before accessing `.search`. - Verified via `npm run test:unit:shard2`. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
e79b2500c8
commit
e6f5ef253f
1 file changed
+1
-1
+1
-1
@@ -198,7 +198,7 @@ function resolveEntryInput(entry) {
|
||||
}
|
||||
|
||||
function getTestRelayOverrides() {
|
||||
if (typeof window === "undefined") return null;
|
||||
if (typeof window === "undefined" || !window.location) return null;
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const paramRelays = params.get("__testRelays__");
|
||||
|
||||
Reference in new issue
Block a user