From a87ca9a392f1bc111f7f40bae9133f38471155de Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Tue, 13 Jun 2017 14:16:57 -0700 Subject: [PATCH] Fix HID crashing on no descriptor Bug: 62461796 Test: compilation test Change-Id: Ic7b1fcc4b6f3c8680f1810679ed609f2691fa4aa --- bta/hh/bta_hh_le.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bta/hh/bta_hh_le.cc b/bta/hh/bta_hh_le.cc index a30f8b818..da503ac5a 100644 --- a/bta/hh/bta_hh_le.cc +++ b/bta/hh/bta_hh_le.cc @@ -1443,6 +1443,11 @@ static void read_report_ref_desc_cb(uint16_t conn_id, tGATT_STATUS status, const tBTA_GATTC_DESCRIPTOR* p_desc = BTA_GATTC_GetDescriptor(conn_id, handle); + if (!p_desc) { + APPL_TRACE_ERROR("%s: error: descriptor is null!", __func__); + return; + } + tBTA_HH_LE_RPT* p_rpt; p_rpt = bta_hh_le_find_report_entry( p_dev_cb, p_desc->characteristic->service->handle, GATT_UUID_HID_REPORT, -- 2.11.0