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>
This commit is contained in:
Tomaz Canabrava 2015-05-31 17:10:26 -03:00 committed by Dirk Hohndel
parent 636aac83f8
commit 8b96179d59

View file

@ -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;
}