From d8f7144971c3e0bb9e9e07eb5532e9fc49d2d053 Mon Sep 17 00:00:00 2001 From: Steffen Deusch Date: Thu, 13 Jun 2024 16:07:35 +0200 Subject: [PATCH] socket.js check if global is available (#5829) Fixes #5825. --- assets/js/phoenix/socket.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/phoenix/socket.js b/assets/js/phoenix/socket.js index 0ec992d3e3..4a79758bcf 100644 --- a/assets/js/phoenix/socket.js +++ b/assets/js/phoenix/socket.js @@ -118,7 +118,7 @@ export default class Socket { this.primaryPassedHealthCheck = false this.longPollFallbackMs = opts.longPollFallbackMs this.fallbackTimer = null - this.sessionStore = opts.sessionStorage || global.sessionStorage + this.sessionStore = opts.sessionStorage || (global && global.sessionStorage) this.establishedConnections = 0 this.defaultEncoder = Serializer.encode.bind(Serializer) this.defaultDecoder = Serializer.decode.bind(Serializer)