diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index 9fca09a087..ddfe80b24f 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -2320,6 +2320,10 @@ WebSocketChannel::CleanupConnection() { LOG(("WebSocketChannel::CleanupConnection() %p", this)); + if(!mSocketThread) { // freed elsewhere, give up here + return; + } + // This should run on the Socket Thread to prevent potential races. bool onSocketThread; nsresult rv = mSocketThread->IsOnCurrentThread(&onSocketThread);