catch nullptr on websocket connections (#4300)

* catch nullptr on websocket connections

* clangify
This commit is contained in:
ebbit1q 2021-04-02 05:34:49 +02:00 committed by GitHub
parent 8e954b10e6
commit b940e17fe7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1692,6 +1692,9 @@ WebsocketServerSocketInterface::~WebsocketServerSocketInterface()
void WebsocketServerSocketInterface::initConnection(void *_socket) void WebsocketServerSocketInterface::initConnection(void *_socket)
{ {
if (_socket == nullptr) {
return;
}
socket = (QWebSocket *)_socket; socket = (QWebSocket *)_socket;
socket->setParent(this); socket->setParent(this);
address = socket->peerAddress(); address = socket->peerAddress();