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

Commit 51aba257 authored by Myles Watson's avatar Myles Watson
Browse files

Don't log the head of an empty list

Bug: 193220499
Test: cert/run
Tag: #stability
Change-Id: Ibfbc0e9c666f3a4317325fe550c51c1cbb7605e7
parent f9f12742
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -308,7 +308,12 @@ struct HciLayer::impl {

  void on_hci_event(EventView event) {
    ASSERT(event.IsValid());
    if (command_queue_.empty()) {
      std::unique_ptr<CommandView> no_waiting_command{nullptr};
      log_hci_event(no_waiting_command, event, module_.GetDependency<storage::StorageModule>());
    } else {
      log_hci_event(command_queue_.front().command_view, event, module_.GetDependency<storage::StorageModule>());
    }
    EventCode event_code = event.GetEventCode();
    // Root Inflamation is a special case, since it aborts here
    if (event_code == EventCode::VENDOR_SPECIFIC) {