Index: device/bluetooth/bluez/bluetooth_device_bluez.cc |
diff --git a/device/bluetooth/bluez/bluetooth_device_bluez.cc b/device/bluetooth/bluez/bluetooth_device_bluez.cc |
index 9f1b448fea9e7b8f2de36bcf3856c9ea3b5ed762..5cdab8d5d92f51f804c7e225ea3789d9b19680c1 100644 |
--- a/device/bluetooth/bluez/bluetooth_device_bluez.cc |
+++ b/device/bluetooth/bluez/bluetooth_device_bluez.cc |
@@ -313,7 +313,10 @@ base::Optional<std::string> BluetoothDeviceBlueZ::GetName() const { |
object_path_); |
DCHECK(properties); |
- return properties->alias.value(); |
+ if (properties->name.is_valid()) |
+ return properties->name.value(); |
+ else |
+ return base::nullopt; |
} |
bool BluetoothDeviceBlueZ::IsPaired() const { |