From 78304282f0a0b3a0aa6a5ab0b7f64893141d6089 Mon Sep 17 00:00:00 2001 From: Jordyfel Date: Mon, 28 Aug 2023 16:39:41 +0300 Subject: [PATCH] Only allow finite numbers in Range.value. --- scene/gui/range.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index 8db4fe42efb4..236dfcc864a1 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -94,6 +94,10 @@ void Range::set_value(double p_val) { } void Range::_set_value_no_signal(double p_val) { + if (!Math::is_finite(p_val)) { + return; + } + if (shared->step > 0) { p_val = Math::round((p_val - shared->min) / shared->step) * shared->step + shared->min; }