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

Commit 52d4ed21 authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk
Browse files

csis: Check if group exist before rank sort

It may happen that read response will come after group removement.
This would cover against null pointer dereference.

Tag: #feature
Bug: 278514112
Test: atest CsisClientTest
Change-Id: I34bb2687609bae250f6f3a4a1c51aab777da6cbc
parent 3336e90b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1106,6 +1106,11 @@ class CsisClientImpl : public CsisClient {

    csis_instance->SetRank((value[0]));
    auto csis_group = FindCsisGroup(csis_instance->GetGroupId());
    if (!csis_group) {
      LOG(ERROR) << __func__ << " Unknown group id yet";
      return;
    }

    csis_group->SortByCsisRank();

    if (notify_valid_services) NotifyCsisDeviceValidAndStoreIfNeeded(device);