profile: clear the chart when there is nothing to display

This is a shouldn't happen situation, because we always
fake a profile. Let's handle it gracefully anyway.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-12-04 16:15:38 +01:00 committed by Dirk Hohndel
parent ecd3334a1c
commit de71435c11

View file

@ -418,8 +418,10 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM
}
const struct divecomputer *currentdc = get_dive_dc_const(d, dc);
if (!currentdc || !currentdc->samples)
if (!currentdc || !currentdc->samples) {
clear();
return;
}
int animSpeed = instant || printMode ? 0 : qPrefDisplay::animation_speed();