redraw profile (actually clean it) if no dive is selected

otherwise the previous selected dive is still visible in the profile
view. clicking on edit crashs subsurface: null pointer dereference in
editCurrentDive as it uses 'current_dive' which is null.

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Martin Gysel 2013-12-07 13:25:17 +01:00 committed by Dirk Hohndel
parent 26dab9b5ce
commit d9ca999a17

View file

@ -86,8 +86,8 @@ void MainWindow::current_dive_changed(int divenr)
if (divenr >= 0) { if (divenr >= 0) {
select_dive(divenr); select_dive(divenr);
ui.globe->centerOn(get_dive(selected_dive)); ui.globe->centerOn(get_dive(selected_dive));
redrawProfile();
} }
redrawProfile();
ui.InfoWidget->updateDiveInfo(divenr); ui.InfoWidget->updateDiveInfo(divenr);
} }