Skip to content

Commit 7ebd45e

Browse files
authored
[sysid] Fix crash when all data is filtered out during analysis (#7199)
1 parent 25c2e26 commit 7ebd45e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sysid/src/main/native/cpp/analysis/FilteringUtils.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,11 @@ static units::second_t GetMaxStepTime(
326326
auto& dataset = it.getValue();
327327

328328
if (IsRaw(key) && wpi::contains(key, "dynamic")) {
329-
auto duration = dataset.back().timestamp - dataset.front().timestamp;
330-
if (duration > maxStepTime) {
331-
maxStepTime = duration;
329+
if (!dataset.empty()) {
330+
auto duration = dataset.back().timestamp - dataset.front().timestamp;
331+
if (duration > maxStepTime) {
332+
maxStepTime = duration;
333+
}
332334
}
333335
}
334336
}

0 commit comments

Comments
 (0)