summaryrefslogtreecommitdiffstats
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-14 19:18:06 -0800
commit040d1dfbada13ecee757ee70b40e3c41e2f1cf45 (patch)
tree38a89707cbdee72ad77850fe9d8b848bce293878
parent11aaf468edbacac397d1d8b20b032eb35cf028ea (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>
-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);