desktop/overridableVar: fix possible crash

This commit is contained in:
Vaxry 2025-12-03 22:43:21 +00:00
parent 93e5e92b0a
commit 9b1891e476
Signed by: vaxry
GPG key ID: 665806380871D640

View file

@ -61,7 +61,7 @@ namespace Desktop::Types {
for (size_t i = 0; i < PRIORITY_END; ++i) {
if constexpr (Extended && !std::is_same_v<T, bool>)
m_values[i] = clampOptional(*other.m_values[i], m_minValue, m_maxValue);
m_values[i] = other.m_values[i].has_value() ? clampOptional(*other.m_values[i], m_minValue, m_maxValue) : other.m_values[i];
else
m_values[i] = other.m_values[i];
}