mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[sysid] Fix crash when all data is filtered out during analysis (#7199)
This commit is contained in:
@@ -326,9 +326,11 @@ static units::second_t GetMaxStepTime(
|
||||
auto& dataset = it.getValue();
|
||||
|
||||
if (IsRaw(key) && wpi::contains(key, "dynamic")) {
|
||||
auto duration = dataset.back().timestamp - dataset.front().timestamp;
|
||||
if (duration > maxStepTime) {
|
||||
maxStepTime = duration;
|
||||
if (!dataset.empty()) {
|
||||
auto duration = dataset.back().timestamp - dataset.front().timestamp;
|
||||
if (duration > maxStepTime) {
|
||||
maxStepTime = duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user