Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12cdf1bf authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by android-build-merger
Browse files

Fix NPE when discovering invalid GATT datatbase

am: 1ebda34c

Change-Id: I1e196651928314494a696e5a3ef126272dd3208a
parents 73872c33 1ebda34c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -318,7 +318,8 @@ static tBTA_GATT_STATUS bta_gattc_add_attr_to_cache(
    descriptor->handle = handle;
    memcpy(&descriptor->uuid, p_uuid, sizeof(tBT_UUID));

    if (service->characteristics == NULL) {
    if (service->characteristics == NULL ||
        list_is_empty(service->characteristics)) {
      APPL_TRACE_ERROR(
          "%s: Illegal action to add descriptor before adding a "
          "characteristic!",