J
John Salerno
Here's my method, and I get an error on the array initialization line.
I've gotte this same error before, and it was fixed by adding the first
line of the method, so I'm not sure what to do now.
private static Status[][][,] ConvertToFlags(int[][][,] allPanels)
{
Status[][][,] panel = new Status[4][][,];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 8; j++)
{
panel[j] = new Status[2, 10]; //Object
reference not set to an instance of an object.
for (int x = 0; x < 2; x++)
for (int y = 0; y < 10; y++)
{
if (allPanels[j][x, y] == 0)
panel[j][x, y] = Status.Off;
else
panel[j][x, y] = Status.Red;
}
}
return panel;
}
I've gotte this same error before, and it was fixed by adding the first
line of the method, so I'm not sure what to do now.
private static Status[][][,] ConvertToFlags(int[][][,] allPanels)
{
Status[][][,] panel = new Status[4][][,];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 8; j++)
{
panel[j] = new Status[2, 10]; //Object
reference not set to an instance of an object.
for (int x = 0; x < 2; x++)
for (int y = 0; y < 10; y++)
{
if (allPanels[j][x, y] == 0)
panel[j][x, y] = Status.Off;
else
panel[j][x, y] = Status.Red;
}
}
return panel;
}