Index: content/renderer/bluetooth/web_bluetooth_impl.cc |
diff --git a/content/renderer/bluetooth/web_bluetooth_impl.cc b/content/renderer/bluetooth/web_bluetooth_impl.cc |
index 3ce2a4b0c463eb78f26d15ba2a2ec82c82be3244..ef89b10da5d1c74e3a1d9b01214f64eafb92cec1 100644 |
--- a/content/renderer/bluetooth/web_bluetooth_impl.cc |
+++ b/content/renderer/bluetooth/web_bluetooth_impl.cc |
@@ -189,7 +189,9 @@ void WebBluetoothImpl::OnRequestDeviceComplete( |
callbacks->onSuccess(base::WrapUnique(new blink::WebBluetoothDeviceInit( |
blink::WebString::fromUTF8(device->id), |
- blink::WebString::fromUTF8(device->name), uuids))); |
+ device->name.is_null() ? blink::WebString() |
+ : blink::WebString::fromUTF8(device->name), |
+ uuids))); |
} else { |
callbacks->onError(ToInt32(error)); |
} |