System.NullReferenceException on conversion to image (second page)

Hi GemBox Team,

I am using GemBox.Bundle in version 51.0.1257-hotfix and I receive the following error:

System.NullReferenceException: Object reference not set to an instance of an object.
   at⸮. , )
   at . , , ⸮ ,  )
   at.( , ,  ,  ,  ,  , ⸮ )
   at.( , , ⸮ ,  , Double )
   at .( , , ⸮ )
   at .( , Int32,  , ⸮ )
   at .( , , ⸮ )
   at .⸮ )
   at ⸮.( , ⸮,  , ⸮ , , )
   at .( , ⸮[], ⸮ , , )
   at .( , Int32, , ⸮ , ⸮ ,  )
   at .( , , Int32 )
(I at .nt32 , Object, Object )
(I   at GemBox.Spreadsheet.ExcelFilePaginator.ejdzwun39fbbvtwqjbnjxdzxum3jetzhnt32 , Object, Object )
     at ..nt32 , Object, Object )
   at ( , Int32, Object )
   at .(Int32 , Size&, Double& )
   at (Int32 )
   at ..( )
   at .. )
   at . , String, Stream )
   at .( , , Stream )
   at GemBox.Spreadsheet.ImageSaveOptions.( , Stream, Boolean )
   at GemBox.Spreadsheet.ImageSaveOptions.zaz4g8cqbty6apf5nnajkhshhk62a7u9 , Stream, Boolean )
   at GemBox.Spreadsheet.ExcelFilePage.Save(Stream stream, SaveOptions options)
   at GemBoxPoc.GemBoxSpreadsheetService.ConvertFile(String inputPath, String outputDirectory) 

when running this application code:

public static void ConvertFile(string inputPath, string outputDirectory)
    {
        var spreadsheet = ExcelFile.Load(inputPath);

      var pages = spreadsheet.GetPaginator(new PaginatorOptions { SelectionType = SelectionType.EntireFile }).Pages;

      for (var index = 0; index < pages.Count; index++)
      {
          var fileName = $"Spreadsheet_Page-{index}.bmp";
          
          var page = pages[index];
          
          using var stream = new FileStream(Path.Combine(outputDirectory, fileName), FileMode.Create);
          
          page.Save(stream, new ImageSaveOptions(ImageSaveFormat.Bmp));
      }
  }

with some documents that produce more than one output page.
However it does not occur with every document, so if necessary I can send you my test file.

Could you have a look at it?

Kind regards,
Sarah

Yes, please send us the test file that reproduces the issue so we can investigate it.

Ok, I sent it via mail.

Hi Sarah,

Please try again with this NuGet package:

Install-Package GemBox.Spreadsheet -Version 49.0.1863-hotfix

Note that this is a hidden pre-released version, to install it you’ll need to run the above command on the NuGet Package Manager Console (Tools → NuGet Package Manager → Package Manager Console).

Does this solve your issue?

Regards,
Mario

Hi Mario,

the new version fixes the issue. Thank you!