mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix a crash when editing manually added dive
I have manually added dives from an ancient version of Subsurface. Trying to edit these caused Subsurface to crash due to comparison of string of dc.model that did not exist (to a static string). And further down the execution path we were crashing as there were no samples associated with the dive. See #941 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
640c746a1f
commit
c0ac73a478
2 changed files with 7 additions and 2 deletions
|
@ -798,7 +798,7 @@ void MainWindow::on_actionEditDive_triggered()
|
|||
}
|
||||
|
||||
const bool isTripEdit = dive_list()->selectedTrips().count() >= 1;
|
||||
if (!current_dive || isTripEdit || strcmp(current_dive->dc.model, "manually added dive")) {
|
||||
if (!current_dive || isTripEdit || (current_dive->dc.model && strcmp(current_dive->dc.model, "manually added dive"))) {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("Trying to edit a dive that's not a manually added dive."));
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue