From cd3d9a26c1dad9e86a0e3a484e3ee3f0a28fb64e Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Fri, 28 Apr 2017 10:35:44 -0700 Subject: [PATCH] client: add null check for adapter proxy --- client/device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/device.c b/client/device.c index ae8b51c6..afa5d5e7 100644 --- a/client/device.c +++ b/client/device.c @@ -355,12 +355,19 @@ static bool device_unbind_interface(const struct proxy_interface *proxy, static void display_device_inline(const char *margin, const void *data) { const struct device *device = data; + const char *adapter_str; + + if (device->adapter && + proxy_interface_get_identity_str(device->adapter)) + adapter_str = proxy_interface_get_identity_str(device->adapter); + else + adapter_str = "-"; display("%s%-*s%-*s%-*s%-*s%-*s\n", margin, 20, device->name ? : "", 20, device->address ? : "", 15, device->state ? : "", - 10, proxy_interface_get_identity_str(device->adapter) ? : "-", + 10, adapter_str, 8, device->scanning ? "scanning" : ""); }