mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(ble/bt): Add NULL check in esp_hid_device example
(cherry picked from commit 8e0f74a2cc)
Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
@@ -278,6 +278,9 @@ static void handle_bt_device_result(struct disc_res_param *disc_res)
|
||||
GAP_DBG_PRINTF(", %s: ", gap_bt_prop_type_names[prop->type]);
|
||||
}
|
||||
if (prop->type == ESP_BT_GAP_DEV_PROP_BDNAME) {
|
||||
if (prop->val == NULL) {
|
||||
continue;
|
||||
}
|
||||
name = (uint8_t *)prop->val;
|
||||
name_len = strlen((const char *)name);
|
||||
GAP_DBG_PRINTF("%s", (const char *)name);
|
||||
|
||||
Reference in New Issue
Block a user