diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2017-08-03 11:15:11 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2017-08-04 07:58:16 +0000 |
commit | d1d06bf7ad2f0c02165f17904d219fc535477f25 (patch) | |
tree | 38d065f597a20054500bd012d1392b4b8b1143cd | |
parent | fa7867a03d927ec65e09b77c8fdcd55608de027e (diff) | |
download | qtconnectivity-d1d06bf7ad2f0c02165f17904d219fc535477f25.tar.gz |
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.cpp | 2 |
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(); |