summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2017-08-03 11:15:11 +0200
committerOliver Wolff <oliver.wolff@qt.io>2017-08-04 07:58:16 +0000
commitd1d06bf7ad2f0c02165f17904d219fc535477f25 (patch)
tree38d065f597a20054500bd012d1392b4b8b1143cd
parentfa7867a03d927ec65e09b77c8fdcd55608de027e (diff)
winrt: Fix crash in QBluetoothServer::nextPendingConnection
If there are no pending connections, the call should not make the application crash but just return nullptr. Change-Id: I33c2ec9b47bbb72abc99ad22035f794724b295ef Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/bluetooth/qbluetoothserver_winrt.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothserver_winrt.cpp b/src/bluetooth/qbluetoothserver_winrt.cpp
index 61134c1f..ddd71c21 100644
--- a/src/bluetooth/qbluetoothserver_winrt.cpp
+++ b/src/bluetooth/qbluetoothserver_winrt.cpp
@@ -217,6 +217,8 @@ bool QBluetoothServer::hasPendingConnections() const
QBluetoothSocket *QBluetoothServer::nextPendingConnection()
{
Q_D(QBluetoothServer);
+ if (d->pendingConnections.count() == 0)
+ return nullptr;
ComPtr<IStreamSocket> socket = d->pendingConnections.takeFirst();