diff --git a/src/SimulationFramework/Polygon.cs b/src/SimulationFramework/Polygon.cs
index 13a5ac7d..f193c722 100644
--- a/src/SimulationFramework/Polygon.cs
+++ b/src/SimulationFramework/Polygon.cs
@@ -146,6 +146,7 @@ private static bool RayLineIntersect(Vector2 position, Vector2 direction, Vector
/// if is convex; otherwise
public static bool IsConvex(ReadOnlySpan polygon, [NotNullWhen(true)] out bool? isClockwise)
{
+ isClockwise = null;
// for a convex polygon every point will have the same winding value
bool isAllClockwise = IsClockwiseWinding(polygon, 0);
for (int i = 0; i < polygon.Length; i++)
@@ -157,7 +158,6 @@ public static bool IsConvex(ReadOnlySpan polygon, [NotNullWhen(true)] o
}
}
- isClockwise = null;
return false;
// determines the winding order at a specific vertex