diff --git a/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs b/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs index b9b134ce..4b2c7ec4 100644 --- a/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs +++ b/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs @@ -27,7 +27,7 @@ private protected static bool ThrowImmutableLength() private protected void ThrowIfIndexOutOfRange(int index) { - if (index < 0 || index >= Length) + if ((uint)index >= (uint)Length) throw new ArgumentOutOfRangeException(nameof(index), "Array index may not be negative or above length of the array"); }