profile: set empty state when there is no current dive to show

The profile data was not properly cleared when not showing a
dive.

Fixes #2787

Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-04-27 21:42:48 +02:00 committed by Robert C. Helling
parent 5ba7c68433
commit 142dc6f96f

View file

@ -566,8 +566,10 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
#endif #endif
if (currentState != ADD && currentState != PLAN) { if (currentState != ADD && currentState != PLAN) {
if (!d) { if (!d) {
if (!current_dive) if (!current_dive) {
setEmptyState();
return; return;
}
d = current_dive; // display the current dive d = current_dive; // display the current dive
} }