cabana: fix crash when no can events in the log (#29795)

fix crash when no events
old-commit-hash: 0afcf1236818f20e159cc2565e57814a08acd883
This commit is contained in:
Dean Lee
2023-09-06 17:36:07 +08:00
committed by GitHub
parent 8702d1b967
commit 6394bf09d3

View File

@@ -170,7 +170,7 @@ void AbstractStream::mergeEvents(std::vector<Event *>::const_iterator first, std
auto insert_pos = std::upper_bound(all_events_.cbegin(), all_events_.cend(), new_events.front(), compare);
all_events_.insert(insert_pos, new_events.cbegin(), new_events.cend());
lastest_event_ts = all_events_.back()->mono_time;
lastest_event_ts = all_events_.empty() ? 0 : all_events_.back()->mono_time;
emit eventsMerged();
}