bug fix: don't crash when computing metrics on empty intervals

This commit is contained in:
Dag Gruneau
2009-12-27 12:47:12 +01:00
committed by Sean Rhea
parent a5f75ec569
commit 7ae6763bc5

View File

@@ -185,6 +185,11 @@ RideSummaryWindow::htmlSummary() const
f.appendPoint(p->secs, p->cad, p->hr, p->km, p->kph, p->nm,
p->watts, p->alt, p->lon, p->lat, 0);
}
if (f.dataPoints().size() == 0) {
// Interval empty, do not compute any metrics
continue;
}
QHash<QString,RideMetricPtr> metrics =
RideMetric::computeMetrics(&f, mainWindow->zones(), intervalMetrics);
if (firstRow) {