@@ 68,7 68,7 @@ std::optional<std::string> klapki::state::state::commit(std::string_view us, con
this->order, original_state.order));
- const auto max_bootnum = std::max(this->entries.rbegin()->first, original_state.entries.rbegin()->first);
+ const auto max_bootnum = std::max(this->entries.rbegin()->first, original_state.entries.empty() ? static_cast<std::uint16_t>(0) : original_state.entries.rbegin()->first);
for(std::size_t i = 0; i <= max_bootnum; ++i) {
const auto now = this->entries.find(i);
const auto orig = original_state.entries.find(i);