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

Commit 2ba6d512 authored by William Escande's avatar William Escande
Browse files

Hap: set available on unknow preset no crash

Bug: 362424892
Test: atest avatar:HapTest#test__set_non_existing_preset_as_available__verify_no_crash_and_no_update
Flag: Exempt feature is not shipped yet, fix has end-to-end test
Change-Id: Id218fccf6bc78586953f8f82255b77b2abe15d55
parent d9eccc61
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1394,6 +1394,12 @@ private:
        break;
      }

      if (!device.has_presets.contains(nt.index)) {
        log::error("Unknown preset. Notification is discarded: {}", nt);
        device.has_journal_.Append(HasJournalRecord(nt));
        device.ctp_notifications_.pop_front();
        continue;
      }
      auto preset = device.has_presets.extract(nt.index).value();
      auto new_props = preset.GetProperties();