From fec33cee93197bc33565b491e21ff191f1421f0a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 23 Sep 2015 16:34:52 -0300 Subject: [PATCH] Don't crash on new dive site Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 7bbcf3fc2..884f76c07 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -813,6 +813,10 @@ void MainTab::updateDisplayedDiveSite() const uint32_t new_uuid = ui.location->currDiveSiteUuid(); qDebug() << "Updating Displayed Dive Site"; + if (new_uuid == RECENTLY_ADDED_DIVESITE) { + qDebug() << "New dive site selected, don't try to update something that doesn't exists yet."; + return; + } if(orig_uuid) { if (new_uuid && orig_uuid != new_uuid) {