summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-05-31 17:10:26 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-31 16:00:51 -0700
commit8b96179d5952fdfbed5e10368986a25bb52a584b (patch)
tree601e1ed91eb9c26d4d6533bda445475b2f696757 /qt-ui
parent636aac83f89b328d355083244e9e658def85af62 (diff)
downloadsubsurface-8b96179d5952fdfbed5e10368986a25bb52a584b.tar.gz
Fix crash when cancelling divesite edit with empty divesite
Only happens if you dont't have any divesites in your list, but either way, it could happen. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/locationinformation.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 657a6f3f5..6dc77c571 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -126,8 +126,7 @@ void LocationInformationWidget::acceptChanges()
void LocationInformationWidget::rejectChanges()
{
- Q_ASSERT(currentDs != NULL);
- if (dive_site_is_empty(currentDs)) {
+ if (currentDs && dive_site_is_empty(currentDs)) {
delete_dive_site(currentDs->uuid);
displayed_dive.dive_site_uuid = 0;
}