mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
srm interval end bug fix
If the user forgot to end an interval before downloading a ride, GC would crash due to an assertion failure. The included ride file demonstrates the bug.
This commit is contained in:
@@ -235,7 +235,8 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings) co
|
||||
for (int i = 1; i < markers.size(); ++i) {
|
||||
const marker &marker = markers[i];
|
||||
double start_secs = result->dataPoints()[marker.start]->secs;
|
||||
double end_secs = result->dataPoints()[marker.end]->secs + result->recIntSecs();
|
||||
int end = qMin(marker.end, result->dataPoints().size() - 1);
|
||||
double end_secs = result->dataPoints()[end]->secs + result->recIntSecs();
|
||||
result->addInterval(last, start_secs, "");
|
||||
result->addInterval(start_secs, end_secs, QString("%1").arg(i));
|
||||
last = end_secs;
|
||||
|
||||
Reference in New Issue
Block a user