summaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-api.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-02-14 19:17:53 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-02-15 03:29:19 +0000
commit01bb1dbfe5fe439f3ccc0a64223405e77e8103f9 (patch)
treebce15e1a4c4d31a04d2f7178eef168cbb070fff9 /binding/bluetooth-api.c
parent2345474f709f8001e16ac7eacae7594f33028812 (diff)
binding: bluetooth: fix segfault when no adapters are connected
Bug-AGL: SPEC-2047 Change-Id: I55a080af35dad1514ee0423eff80e65331891bc7 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/bluetooth-api.c')
-rw-r--r--binding/bluetooth-api.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c
index 52d4f19..9ce0541 100644
--- a/binding/bluetooth-api.c
+++ b/binding/bluetooth-api.c
@@ -290,6 +290,10 @@ static void bluez_devices_signal_callback(
g_variant_get(parameters, "(&oa{sa{sv}})", &path, &array);
+ // no adapter or device in path
+ if (!g_strcmp0(path, BLUEZ_PATH))
+ return;
+
jresp = json_object_new_object();
json_process_path(jresp, path);