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

Commit d2537ad0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "leaudio: Fix possible crash"

parents 72b0bc27 1bc4d4a1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2174,6 +2174,12 @@ class LeAudioClientImpl : public LeAudioClient {
             ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_),
             leAudioDevice->autoconnect_flag_, reason);

    if (group == nullptr) {
      LOG_ERROR("Group id %d is null", leAudioDevice->group_id_);
      leAudioDevice->SetConnectionState(DeviceConnectState::DISCONNECTED);
      return;
    }

    if (reason != GATT_CONN_TERMINATE_LOCAL_HOST ||
        leAudioDevice->autoconnect_flag_) {
      leAudioDevice->SetConnectionState(