diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp index ed660a319..5c56e3e4a 100644 --- a/src/gui/game/PropertyTool.cpp +++ b/src/gui/game/PropertyTool.cpp @@ -25,6 +25,10 @@ void ParseFloatProperty(String value, float &out) { + if (!value.size()) + { + throw std::out_of_range("empty string"); + } if (value.EndsWith("C")) { float v = value.SubstrFromEnd(1).ToNumber(); diff --git a/src/gui/options/OptionsView.cpp b/src/gui/options/OptionsView.cpp index 3fb2bb8a5..2e9afb14e 100644 --- a/src/gui/options/OptionsView.cpp +++ b/src/gui/options/OptionsView.cpp @@ -476,7 +476,7 @@ void OptionsView::UpdateAirTemp(String temp, bool isDefocus) ambientAirTemp->SetText(sb.Build()); } // Out of range temperatures are invalid, preview should go away - else if (airTemp < MIN_TEMP || airTemp > MAX_TEMP) + else if (isValid && (airTemp < MIN_TEMP || airTemp > MAX_TEMP)) isValid = false; // If valid, set temp