Hello,
I have a script that uses the ‘.Count’ property of a List variable, inside a ‘for loop’ (to determine the count of the loop), and when I run the program, I get an error FROM my for loop that says…
NullReferenceException: Object reference not set to an instance of an object
The List is NOT ‘empty’ or ‘null’ (when I print it out BEFORE the ‘for loop’ starts), so, I decided to store the ‘.Count’ property value inside an integer, and THEN put the integer inside my for loop, and I get the error from the code that is INSIDE my for loop, instead of FROM the for loop. I wonder WHY that is happening.