diff options
Diffstat (limited to 'src/user-awareness-device.c')
-rwxr-xr-x[-rw-r--r--] | src/user-awareness-device.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/user-awareness-device.c b/src/user-awareness-device.c index 133f18c..c6a97fc 100644..100755 --- a/src/user-awareness-device.c +++ b/src/user-awareness-device.c @@ -350,11 +350,15 @@ void _ua_handle_device_added(int result, uam_device_info_s *uam_info) result = _ua_get_error_code(result); if (UA_ERROR_NONE != result) { - dev = __ua_get_device_from_list(uam_info->device_id, - uam_info->mac, _to_ua_mac_type(uam_info->type)); - if (NULL != dev) - UA_ERR("Add device failed for Id:[%s] MAC type:[0x%4.4X]", - dev->device_id, dev->type); + if (NULL == uam_info) { + UA_ERR("Add device failed [%s]", _ua_get_error_string(result)); + } else { + dev = __ua_get_device_from_list(uam_info->device_id, + uam_info->mac, _to_ua_mac_type(uam_info->type)); + if (NULL != dev) + UA_ERR("Add device failed for Id:[%s] MAC type:[0x%4.4X]", + dev->device_id, dev->type); + } } else { dev = __ua_add_device_info_to_list(uam_info); } |