At the top of my code (before constructor) I write:
String[] CAN = null;
This string array is updated in another function.
Later in my code I have this foreach loop:
foreach (String str in CAN)
{
if(str.Contains("18FA07FE"))
cmdResult = true;
else
cmdResult = false;
}
I have tried to debug, and at the line of the foreach statement I can see that the CAN string array has successfully been updated, and now contains 1211 elements.
So I don't really know why it's giving me this exception.