null exception when opening empty excel

Mar 8, 2014 at 9:56 AM
Edited Mar 8, 2014 at 11:01 AM
Hi , I have null exception when I try to open attached file this way

var workbook = new XLWorkbook("C:\template.xlsx");

file


on SO http://stackoverflow.com/questions/22268046/closedxml-null-exception-when-open-excel

I am trying to debug this and seems that this is because of conditional formating is null

the problem was in LoadConditionalFormatting
instead of

if (conditionalFormatting == null) return;

should be
if (conditionalFormatting == null || conditionalFormatting.SequenceOfReferences == null) return;