Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Commented Unassigned: Bug with Dispose method [15207]

$
0
0
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

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>