Fix NullPointerException

This commit is contained in:
Philipp Heckel 2026-01-23 14:09:51 -05:00
parent 18ba443da6
commit 1b2d8bac80

View file

@ -191,8 +191,8 @@ class WsConnection(
// - Handle servers that do not support WebSockets
val error = when {
isConnectionBrokenException(t) -> null
isProtocolException(t) -> WebSocketNotSupportedException(response!!.code, response.message, t)
isResponseCode(response, 401, 403) -> NotAuthorizedException(response!!.code, response.message, t)
isProtocolException(t) && response != null -> WebSocketNotSupportedException(response.code, response.message, t)
isResponseCode(response, 401, 403) && response != null -> NotAuthorizedException(response.code, response.message, t)
else -> t
}
connectionDetailsListener(baseUrl, ConnectionState.CONNECTING, error, nextRetryTime)