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

fix crash when no events
This commit is contained in:
Dean Lee
2023-09-06 17:36:07 +08:00
committed by GitHub
parent 89d6bc6c7b
commit 0afcf12368
+1 -1
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();
}