So I’m getting an ArgumentOutOfRangeException
error that makes no sense to me. Whenever it tries to access a certain variable at a particular index in a List<>
, I run a check to see if the List<>
count is actually greater than or equal to the index I’m trying to access, but yet I still get the error. So I debugged it to see if maybe it was still searching for an out of range index, but it was searching for objects well within the List. Sometimes it would look for the 13th index in a List with 27 items, which means that an object should be there, yet I still get the error. I’ve checked all the times the error comes out, and every time is still gives me the error. So my question is whether or not ArgumentOutOfRangeException only refers to checking for an index outside of the range of the List, or to other things too?
nodeCount is a custom variable, which could be wrong.
Arrays are zero-based, so array[length-1+1] = array[length] is always null. Your +1 additions are pushing row and column out of bounds.