Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2467)

Unified Diff: device/bluetooth/bluetooth_device.cc

Issue 2785383002: Update unit tests for BluetoothDevice::GetPrimaryServicesByUUID() etc. (Closed)
Patch Set: update unit tests for BluetoothDevice::GetPrimaryServicesByUUID() etc. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index 665cbb685a68da5afedd3e6cdd60dd8898597fff..1820fe464bc979ab177c332e8c06d2690639b2ee 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -490,12 +490,14 @@ BluetoothDevice::GetDescriptorsByUUID(
device::BluetoothRemoteGattCharacteristic* characteristic,
const BluetoothUUID& descriptor_uuid) {
std::vector<device::BluetoothRemoteGattDescriptor*> descriptors;
- DVLOG(1) << "Looking for descriptor: " << descriptor_uuid.canonical_value();
- for (auto* descriptor : characteristic->GetDescriptors()) {
- DVLOG(1) << "Descriptor in cache: "
- << descriptor->GetUUID().canonical_value();
- if (descriptor->GetUUID() == descriptor_uuid) {
- descriptors.push_back(descriptor);
+ if (characteristic) {
+ DVLOG(1) << "Looking for descriptor: " << descriptor_uuid.canonical_value();
+ for (auto* descriptor : characteristic->GetDescriptors()) {
+ DVLOG(1) << "Descriptor in cache: "
+ << descriptor->GetUUID().canonical_value();
+ if (descriptor->GetUUID() == descriptor_uuid) {
+ descriptors.push_back(descriptor);
+ }
}
}
return descriptors;
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_device_unittest.cc » ('j') | device/bluetooth/bluetooth_device_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698