I'm getting a NullReferenceException
on a List
, and I'm not sure why. Please excuse the spaghetti. I've looked through the line by line debugger, and I'm not seeing any issues. The debugger doesn't throw any exception at all. Does anyone see what's going on here? I've commented where the list is initialized and where the exception is being thrown.
public void ProcessFile()
{
var book = new Aspose.Cells.Workbook(File);
var sheet = book.Worksheets[0];
var cells = sheet.Cells;
// List is initialized here
List<double> dailyValues = new List<double>(5);
for (int i = 2; i <= cells.MaxDataColumn; i++)
{
Individual associate = new Individual((string) cells[i,0].Value);
for (int j = 1; j <= cells.MaxDataRow; j++)
{
if (j % 6 == 4) continue;
//Exception being thrown here
dailyValues.Add((double) cells[i, j].Value);
if (dailyValues.Count == 5)
{
associate.addDailyNumbers(new DailyNumbers(dailyValues));
dailyValues.Clear();
}
}
Associates.Add(associate);
}
}
}