diff --git a/content/base/src/nsWebSocket.cpp b/content/base/src/nsWebSocket.cpp index bdf67ce21c8a..4fe7e1271c54 100644 --- a/content/base/src/nsWebSocket.cpp +++ b/content/base/src/nsWebSocket.cpp @@ -1300,7 +1300,9 @@ nsWebSocket::Close() // before calling it nsRefPtr kungfuDeathGrip = this; - mConnection->FailConnection(); + if (mConnection) { + mConnection->FailConnection(); + } return NS_OK; }