From 01bb1dbfe5fe439f3ccc0a64223405e77e8103f9 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Thu, 14 Feb 2019 19:17:53 -0800 Subject: binding: bluetooth: fix segfault when no adapters are connected Bug-AGL: SPEC-2047 Change-Id: I55a080af35dad1514ee0423eff80e65331891bc7 Signed-off-by: Matt Ranostay --- binding/bluetooth-api.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit 1.2.3-korg