Skip to content

Commit

Permalink
Fixed possible exception when items are cleared in a list in a collis…
Browse files Browse the repository at this point in the history
…ion method.
  • Loading branch information
vchelaru committed Dec 18, 2023
1 parent 5f09d5c commit 5466218
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,10 @@ private bool DoPartitionedYCollision(float? maxDistanceOnSecondaryAxis)

for (int i = firstList.Count - 1; i > -1; i--)
{
if(i >= firstList.Count)
{
continue;
}
var first = firstList[i];
parameters.ItemInFirstList = first;
parameters.FirstIndex = i;
Expand Down Expand Up @@ -1685,6 +1689,10 @@ private bool DoPartitionedXCollision(float? maxDistanceOnSecondaryAxis)

for (int i = firstList.Count - 1; i > -1; i--)
{
if (i >= firstList.Count)
{
continue;
}
var first = firstList[i];
parameters.ItemInFirstList = first;
parameters.FirstIndex = i;
Expand Down

0 comments on commit 5466218

Please sign in to comment.