Pārlūkot izejas kodu

Fix accessing potentially non-existing UI element

Ivan Savenko 2 gadi atpakaļ
vecāks
revīzija
108688389e
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      client/windows/settings/GeneralOptionsTab.cpp

+ 2 - 1
client/windows/settings/GeneralOptionsTab.cpp

@@ -173,7 +173,8 @@ GeneralOptionsTab::GeneralOptionsTab()
 	scalingLabel->setText(scalingToLabelString(currentResolution["scaling"].Integer()));
 
 	std::shared_ptr<CLabel> longTouchLabel = widget<CLabel>("longTouchLabel");
-	longTouchLabel->setText(longTouchToLabelString(settings["general"]["longTouchTimeMilliseconds"].Integer()));
+	if (longTouchLabel)
+		longTouchLabel->setText(longTouchToLabelString(settings["general"]["longTouchTimeMilliseconds"].Integer()));
 
 	std::shared_ptr<CToggleButton> spellbookAnimationCheckbox = widget<CToggleButton>("spellbookAnimationCheckbox");
 	spellbookAnimationCheckbox->setSelected(settings["video"]["spellbookAnimation"].Bool());