dotnetcore / NPOI

A .NET library for reading and writing Microsoft Office binary and OOXML file formats.
Apache License 2.0
1.93k stars 413 forks source link

Getting error "Nullable object must have a value." for method GetColumnStyle(<int>) if style is not available for column #160

Open 9555213555 opened 4 years ago

9555213555 commented 4 years ago

When using GetColumnStyle method of ISheet interface, getting the error "Nullable object must have a value."

var workbook = new XSSFWorkbook(fileStreem); var worksheet = package.GetSheetAt(0); var columnStyle = worksheet?.GetColumnStyle(0); // Getting error "Nullable object must have a value." here if style for the column doesn't exists.