mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Tier2: fix websocket bug
CWebSocket::ConnContext_s::webSocket can be null, added a check.
This commit is contained in:
parent
df8d920eea
commit
d3f5c27492
@ -275,7 +275,7 @@ bool CWebSocket::ConnContext_s::Process(const double queryTime)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CWebSocket::ConnContext_s::SetParams(const ConnParams_s& params)
|
||||
{
|
||||
Assert(webSocket);
|
||||
Assert(webSocket, "Can't set parameters on a NULL instance!");
|
||||
|
||||
if (params.timeOut > 0)
|
||||
ProtoWebSocketControl(webSocket, 'time', params.timeOut, 0, NULL);
|
||||
@ -292,11 +292,15 @@ void CWebSocket::ConnContext_s::SetParams(const ConnParams_s& params)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CWebSocket::ConnContext_s::Disconnect()
|
||||
{
|
||||
ProtoWebSocketDisconnect(webSocket);
|
||||
ProtoWebSocketUpdate(webSocket);
|
||||
ProtoWebSocketDestroy(webSocket);
|
||||
if (webSocket)
|
||||
{
|
||||
ProtoWebSocketDisconnect(webSocket);
|
||||
ProtoWebSocketUpdate(webSocket);
|
||||
ProtoWebSocketDestroy(webSocket);
|
||||
|
||||
webSocket = nullptr;
|
||||
}
|
||||
|
||||
webSocket = nullptr;
|
||||
state = CS_UNAVAIL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user