From 8f8f901aa8d4044b6fad9195ece5f96021fa57c8 Mon Sep 17 00:00:00 2001 From: "Rafael M. Salvioni" Date: Wed, 12 Jul 2023 18:49:03 -0300 Subject: [PATCH] Check "hasDCSalinity" is null in updateWaterTypeWidget() Signed-off-by: Rafael M. Salvioni --- desktop-widgets/tab-widgets/TabDiveInformation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop-widgets/tab-widgets/TabDiveInformation.cpp b/desktop-widgets/tab-widgets/TabDiveInformation.cpp index ab0630e59..d64509cee 100644 --- a/desktop-widgets/tab-widgets/TabDiveInformation.cpp +++ b/desktop-widgets/tab-widgets/TabDiveInformation.cpp @@ -95,7 +95,7 @@ void TabDiveInformation::closeWarning() void TabDiveInformation::updateWaterTypeWidget() { // Decide on whether to show the water type/salinity combobox or not - bool hasDCSalinity = parent.currentDive->salinity != 0; + bool hasDCSalinity = parent.currentDive && parent.currentDive->salinity != 0; if (prefs.salinityEditDefault || !hasDCSalinity) { // if the preference setting has been checked or DC doesnt have salinity info ui->waterTypeText->setVisible(false); ui->waterTypeCombo->setVisible(true); // show combobox