From 7e532865386d9adb92ba6d48dc7df80726977b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 28 Apr 2022 10:26:26 +0200 Subject: [PATCH] Fix potential crash if the remote client is not available any more --- libnymea-remoteproxy/proxy/proxyserver.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnymea-remoteproxy/proxy/proxyserver.cpp b/libnymea-remoteproxy/proxy/proxyserver.cpp index 42274b5..28681d2 100644 --- a/libnymea-remoteproxy/proxy/proxyserver.cpp +++ b/libnymea-remoteproxy/proxy/proxyserver.cpp @@ -300,6 +300,10 @@ void ProxyServer::onClientDataAvailable(const QUuid &clientId, const QByteArray // Calculate server statisitcs m_troughputCounter += data.count(); proxyClient->addRxDataCount(data.count()); + + if (!remoteClient) + return; + remoteClient->addTxDataCount(data.count()); m_totalTraffic += data.count();