When used in a using code block and calling individual Dispose() methods, when exiting the using block an "object not set to an instance of an object" exception is thrown.
Code to reproduce:
```
using (ExcelPackage ep = new ExcelPackage(new FileInfo(some_file)))
{
ExcelWorkbook wb = ep.Workbook;
if (wb != null)
{
ExcelWorksheet ws = null;
if (wb.Worksheets[y].Name == fcSourceFiles[x].Worksheet)
{
ws = wb.Worksheets[y];
}
if (ws != null)
{
//do something with the worksheet
ws.Dispose();
}
wb.Dispose();
} //if wb != null
wb = null;
//do some other things
//running through this next line now throws the null reference exception
//so the inbuilt dispose method doesn't work properly.
} //using (ExcelPackage ep = new ExcelPackage(new FileInfo(some_file))
```
Comments: Fixed in changeset d0875555c58d
Code to reproduce:
```
using (ExcelPackage ep = new ExcelPackage(new FileInfo(some_file)))
{
ExcelWorkbook wb = ep.Workbook;
if (wb != null)
{
ExcelWorksheet ws = null;
if (wb.Worksheets[y].Name == fcSourceFiles[x].Worksheet)
{
ws = wb.Worksheets[y];
}
if (ws != null)
{
//do something with the worksheet
ws.Dispose();
}
wb.Dispose();
} //if wb != null
wb = null;
//do some other things
//running through this next line now throws the null reference exception
//so the inbuilt dispose method doesn't work properly.
} //using (ExcelPackage ep = new ExcelPackage(new FileInfo(some_file))
```
Comments: Fixed in changeset d0875555c58d