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

Edited 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;
```



Viewing all articles
Browse latest Browse all 1877

Trending Articles