aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-09-29 09:36:00 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-09-29 09:36:00 +0000
commitb01126f637ccdc9f87024bd08e03a438888c09a1 (patch)
tree22ca937fd167ea750256df662f10553fb5f28856
parent99dc56c4254ea9b3b115401fda18e1935be5d897 (diff)
parent507aff23c30da749d96e1cd41c9082513ced83e6 (diff)
downloadayatana-indicator-bluetooth-b01126f637ccdc9f87024bd08e03a438888c09a1.tar.gz
ayatana-indicator-bluetooth-b01126f637ccdc9f87024bd08e03a438888c09a1.tar.bz2
ayatana-indicator-bluetooth-b01126f637ccdc9f87024bd08e03a438888c09a1.zip
Check for NULL when getting cached properties Address and UUIDs. Fixes: #1497928
Approved by: PS Jenkins bot, Sebastien Bacher
-rw-r--r--src/bluez.vala11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bluez.vala b/src/bluez.vala
index 208ae75..80682cc 100644
--- a/src/bluez.vala
+++ b/src/bluez.vala
@@ -273,7 +273,7 @@ public class Bluez: Bluetooth, Object
// look up the device's bus address
v = device_proxy.get_cached_property ("Address");
- var address = v.get_string ();
+ var address = v == null ? null : v.get_string ();
// look up the device's bus address
v = device_proxy.get_cached_property ("Icon");
@@ -285,10 +285,13 @@ public class Bluez: Bluetooth, Object
// derive the uuid-related attributes we care about
v = device_proxy.get_cached_property ("UUIDs");
- string[] uuid_strings = v.dup_strv ();
uint16[] uuids = {};
- foreach (var s in uuid_strings)
- uuids += get_uuid16_from_uuid_string (s);
+ if (v != null)
+ {
+ string[] uuid_strings = v.dup_strv ();
+ foreach (var s in uuid_strings)
+ uuids += get_uuid16_from_uuid_string (s);
+ }
var supports_browsing = device_supports_browsing (uuids);
var supports_file_transfer = device_supports_file_transfer (uuids);