Set Activity plot to Blank when the x-axis series is not present

Fixes #3588
This commit is contained in:
Ale Martinez
2021-05-01 21:09:26 -03:00
parent c9e01353a0
commit 6c2a435759

View File

@@ -1813,8 +1813,10 @@ AllPlotWindow::rideSelected()
return;
}
// ignore if null, or manual / empty
if (!ride || !ride->ride() || !ride->ride()->dataPoints().count()) {
// ignore if null, or manual / empty, or x-axis series is not present
if (!ride || !ride->ride() || !ride->ride()->dataPoints().count() ||
(comboDistance->currentIndex() == 1 && !ride->ride()->isDataPresent(RideFile::km)) ||
(comboDistance->currentIndex() != 1 && !ride->ride()->isDataPresent(RideFile::secs))) {
current = NULL;
setIsBlank(true);
return;