From 8b96179d5952fdfbed5e10368986a25bb52a584b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 31 May 2015 17:10:26 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 3 +-- 1 file changed, 1 insertion(+), 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; } -- cgit v1.2.3-70-g09d2