mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-24 13:29:01 +08:00
fix: don't accept NaN and Infinity for default value setting
This commit is contained in:
parent
b6b67c0e0d
commit
04ddfda878
@ -74,7 +74,9 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
_defaultValueField.value = 0;
|
_defaultValueField.value = 0;
|
||||||
_hasExplicitDefaultValueField.value = false;
|
_hasExplicitDefaultValueField.value = false;
|
||||||
}
|
}
|
||||||
else if (float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var parsed))
|
else if (float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var parsed)
|
||||||
|
&& !float.IsNaN(parsed)
|
||||||
|
&& !float.IsInfinity(parsed))
|
||||||
{
|
{
|
||||||
_defaultValueField.value = _syncType switch
|
_defaultValueField.value = _syncType switch
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user