NullPointerException when saving workbook to ByteArrayOutputStream

Hi!

We use aspose-cells-7.6.0 for Java.
Simple code:

Workbook workbook = new Workbook(“test.xlsx”);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
workbook.save(baos, SaveFormat.AUTO);

according to the documentation SaveFormat.AUTO should work as following:
If saving the file to the disk,the file format format accords to the extesion of the file name.
If saving the file to the stream, the file format is xlsx.

but instead it generates:
Exception in thread “main” java.lang.NullPointerException
at com.aspose.cells.OoxmlSaveOptions.(Unknown Source)
at com.aspose.cells.FileFormatUtil.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)

when changing SaveFormat.AUTO to SaveFormat.XLSX all works fine.
Bug?

Many thanks for considering my request.

Hi Serg,

Thanks for your posting and using Aspose.Cells for Java.

We were able to reproduce this exception. It can occur with any source file. We have logged this issue in our database. We will look into it and resolve this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40661.

Hi,

Thanks for using Aspose.Cells.

We have fixed this issue.

Please download and try this fix: Aspose.Cells for Java v7.6.1.1 and let us know your feedback.