WebSocketServer: Don't try to send events if the server is not listening

This commit is contained in:
tt2468 2021-05-10 18:26:28 -07:00
parent 23b6ce607c
commit 902c9dfdc5

View File

@ -188,6 +188,9 @@ std::vector<WebSocketServer::WebSocketSessionState> WebSocketServer::GetWebSocke
// It isn't consistent to directly call the WebSocketServer from the events system, but it would also be dumb to make it unnecessarily complicated.
void WebSocketServer::BroadcastEvent(uint64_t requiredIntent, std::string eventType, json eventData)
{
if (!_server.is_listening())
return;
QtConcurrent::run(&_threadPool, [=]() {
// Populate message object
json eventMessage;