summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2019-04-09 15:57:23 +0200
committerAlex Blasche <alexander.blasche@qt.io>2019-04-12 12:12:16 +0000
commit72f3ad1dbe66ad4700417e6f681f92320e2fd183 (patch)
tree84f5b944d7e959c9713b2bcf89888a1f89717f69
parent04fc614b5650f39331ed672c9f11f57c1df0836c (diff)
Don't create QBluetoothServiceInfo when uuid is null
Sometimes Android returns a null uuid as SDP result. There is no point processing them further. Change-Id: I07b52e79a31becda72452e3446aca9ea4933968b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_android.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
index 5e6ddadb..3ab0d580 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp
@@ -390,9 +390,12 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB
};
for (int i = 0; i < uuids.count(); i++) {
+ const QBluetoothUuid &uuid = uuids.at(i);
+ if (uuid.isNull())
+ continue;
+
QBluetoothServiceInfo serviceInfo;
serviceInfo.setDevice(remoteDevice);
- const QBluetoothUuid &uuid = uuids.at(i);
QBluetoothServiceInfo::Sequence protocolDescriptorList;
{