From fbb14ed66dc80845a1b68aced194914dbae82949 Mon Sep 17 00:00:00 2001 From: Arkadiusz Pietraszek Date: Wed, 12 Aug 2020 11:13:42 +0200 Subject: [PATCH] [Bluetooth][fix] Small fix of crash in ParseServiceData There was a small mistake that caused crash when advertising with BLE adapter and using service data. [Verification] Code compiles and executes without crash or errors. Change-Id: I4254e800ee7fda21e6eb71c7f7f03d6b4a399beb Signed-off-by: Arkadiusz Pietraszek --- src/bluetooth/bluetooth_le_adapter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bluetooth/bluetooth_le_adapter.cc b/src/bluetooth/bluetooth_le_adapter.cc index 2a0fcd67..caad799e 100644 --- a/src/bluetooth/bluetooth_le_adapter.cc +++ b/src/bluetooth/bluetooth_le_adapter.cc @@ -119,7 +119,7 @@ class BluetoothLEServiceData : public ParsedDataHolder { private: BluetoothLEServiceData(UUID&& uuid, const std::string& data_str) : uuid_{std::move(uuid)} { - ScopeLogger("UUID: %s, data_str: %s", uuid.uuid_128_bit.c_str(), data_str.c_str()); + ScopeLogger("UUID: %s, data_str: %s", uuid_.uuid_128_bit.c_str(), data_str.c_str()); data_.Parse(data_str); @@ -325,7 +325,7 @@ class BluetoothLEAdvertiseData : public ParsedDataHolder { const auto& service_data_obj = obj.get(kServiceData); if (service_data_obj.is()) { return true; - } else if (!service_data_obj.is()) { + } else if (!service_data_obj.is()) { return false; } -- 2.34.1