Skip to content

Commit a24bfde

Browse files
Eiderenxen2
authored andcommitted
fix: Bepu float validation
1 parent 535b988 commit a24bfde

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/BepuAndStrideExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void ValidateRange<T>(this SQuaternion quat, T owner, [CallerMembe
5252
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5353
public static void ValidateGreaterThanZeroFinite<T>(this float fp, T owner, [CallerMemberName] string? fieldName = null)
5454
{
55-
if (fp > 0 && float.IsFinite(fp))
55+
if (fp <= 0 || float.IsFinite(fp) == false)
5656
throw new ArgumentOutOfRangeException($"{owner}'s {fieldName} must be finite and greater than zero");
5757
}
5858
}

0 commit comments

Comments
 (0)