Index: chrome/browser/extensions/api/bluetooth_low_energy/utils.cc |
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc b/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc |
index c3b65d19d7afd52ae167bb3ba3ae29da03f2dd8c..a3143f2cd3c4774fcb9fb149934143d29565c2d6 100644 |
--- a/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc |
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc |
@@ -4,6 +4,12 @@ |
#include "chrome/browser/extensions/api/bluetooth_low_energy/utils.h" |
+#include <stddef.h> |
+#include <iterator> |
+#include <vector> |
+ |
+#include "base/logging.h" |
+ |
namespace extensions { |
namespace api { |
namespace bluetooth_low_energy { |
@@ -38,10 +44,13 @@ std::unique_ptr<base::DictionaryValue> CharacteristicToValue( |
} |
std::unique_ptr<base::DictionaryValue> DescriptorToValue(Descriptor* from) { |
+ if (!from->characteristic) |
+ return from->ToValue(); |
+ |
// Copy the characteristic properties and set them later manually. |
std::vector<CharacteristicProperty> properties = |
- from->characteristic.properties; |
- from->characteristic.properties.clear(); |
+ from->characteristic->properties; |
+ from->characteristic->properties.clear(); |
std::unique_ptr<base::DictionaryValue> to = from->ToValue(); |
base::DictionaryValue* chrc_value = NULL; |