Strava download - avoid crashes when lap swim file has 0 lenght lap

Includes sample file from users forum
This commit is contained in:
Alejandro Martinez
2022-10-26 11:17:23 -03:00
parent 8946c53650
commit 6f4da994a2
2 changed files with 1 additions and 1 deletions

View File

@@ -973,7 +973,7 @@ Strava::prepareResponse(QByteArray* data)
double start = starttime.secsTo(QDateTime::fromString(lap["start_date_local"].toString(), Qt::ISODate));
if (start < last_lap) start = last_lap + 1; // Don't overlap
double end = start + lap["elapsed_time"].toDouble() - 1;
double end = start + std::max(lap["elapsed_time"].toDouble(), 1.0) - 1;
last_lap = end;

BIN
test/swims/Morning_Swim.fit Normal file

Binary file not shown.