Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Commented Issue: Loading an XLSX file fails with NullReferenceException [9437]

$
0
0
NullReferenceException occurs in XLWorkbook_Load method when opening attached XLSX file:

```
var xl = new XLWorkbook("Bug_118703_WriteMatrixToExcelNullReferenceException.xlsx");
```


> at ClosedXML.Excel.XLWorkbook.LoadConditionalFormatting(ConditionalFormatting conditionalFormatting, XLWorksheet ws, Dictionary`2 differentialFormats) in c:\work\QualiSystems\Trunk\Tools\API\3rdParty\ClosedXml\Sources\ClosedXML\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 1425

Can be fixed by adding null check:
```

if (conditionalFormatting == null || conditionalFormatting.SequenceOfReferences == null ) return;
```


Comments: The bug is reproduced only when file name is "MoBC_1111_MoCBC_PD11______.1T__DUStr.xlsx"

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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