Document.updateFields throws java.lang.NullPointerException on MAC OS

Hi,
I hope you are well,

I would like to build a document including nested tables with merged cells.
When I set the autoFit mode of tables to FIXED_COLUMN_WIDTHS in a specific template, it fails with NullPointerException.
I attach a sample code here demonstrating the error.

aspose-npe.zip (615.4 KB)

Regards,
Behrouz

@behrouz

We have tested the scenario using the latest version of Aspose.Words for Java 19.7 and have not found the shared issue. So, please use Aspose.Words for Java 19.7.

@tahir.manzoor

I’m not sure If this issue is only related to the nested tables in a specific autofit mode. I tested it with the latest version of aspos and the issue still remains.
Actually, I just extracted the logic from our product to reproduce this issue and realized that it would happen in combination with some other things in a certain file (template.docx) which I’ve added to the project.
If you run the application from the previous post you will get the error.
To be mentioned that if you comment the updateFields call from the program, it will work without throwing any errors.

Regards,
Behrouz

@behrouz

We have not found any exception while using the latest version of Aspose.Words for Java i.e. 19.7. We have attached the output document with this post for your kind reference. 19.7-out.zip (568.1 KB)

Have you tried the Aspose.Words for Java 19.7?

@tahir.manzoor

I tested the scenario with version 19.7 and got the following error:

Exception in thread "main" java.lang.NullPointerException
at com.aspose.words.zzX.zzZ(Unknown Source)
at com.aspose.words.zzX.zzZ(Unknown Source)
at com.aspose.words.zzX.zzZ(Unknown Source)
at com.aspose.words.zzX.zzQ(Unknown Source)
at com.aspose.words.zzX.zzZ(Unknown Source)
at com.aspose.words.zzX.zzX(Unknown Source)
at com.aspose.words.zzX.zzK(Unknown Source)
at com.aspose.words.zzYWP.zzYNo(Unknown Source)
at com.aspose.words.zzYWP.zzYNm(Unknown Source)
at com.aspose.words.zzYWP.zzY(Unknown Source)
at com.aspose.words.zzYWP.zzZ(Unknown Source)
at com.aspose.words.zzX.zzY(Unknown Source)
at com.aspose.words.zzX.zzN(Unknown Source)
at com.aspose.words.zzVV.zzV(Unknown Source)
at com.aspose.words.zzVV.zzZ(Unknown Source)
at com.aspose.words.zzYWP.zzYNm(Unknown Source)
at com.aspose.words.zzYWP.zzY(Unknown Source)
at com.aspose.words.zzYWP.zzZ(Unknown Source)
at com.aspose.words.zzXH.zziJ(Unknown Source)
at com.aspose.words.zzXH.zzW(Unknown Source)
at com.aspose.words.zzXH.zzX(Unknown Source)
at com.aspose.words.zzZ5Z.zzG(Unknown Source)
at com.aspose.words.zzZ5Z.zzH(Unknown Source)
at com.aspose.words.zzZ5Z.zzZ27(Unknown Source)
at com.aspose.words.zzZ5Z.zzO(Unknown Source)
at com.aspose.words.zzZ5C.zzF(Unknown Source)
at com.aspose.words.zzYUS.zzb(Unknown Source)
at com.aspose.words.zz8Q.zzF(Unknown Source)
at com.aspose.words.zz8R.zzZNW(Unknown Source)
at com.aspose.words.zzZ68.zzZ2t(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.zz3X.perform(Unknown Source)
at com.aspose.words.zz3Y.zzHs(Unknown Source)
at com.aspose.words.zz0Z.zzYg(Unknown Source)
at com.aspose.words.zz0Z.zzZ(Unknown Source)
at com.aspose.words.zz0Z.zzZ4(Unknown Source)
at com.aspose.words.Range.updateFields(Unknown Source)
at com.aspose.words.Document.updateFields(Unknown Source)
at com.k15t.test.aspose.words.AsposeNPE.updateAndSaveDoc(AsposeNPE.java:393)
at com.k15t.test.aspose.words.AsposeNPE.main(AsposeNPE.java:444)

I’m running this program on Mac OS.

@behrouz

We tested the scenario at Windows 10 and Java 8. We will setup the Mac operating system at our end and will share our findings with you soon.

@behrouz

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJAVA-2152. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

A post was split to a new topic: Document.updateFields throws java.lang.NullPointerException

@behrouz

We have not faced this issue while using the latest version of Aspose.Words for Java 21.2. So, please try Aspose.Words for Java 21.2.

The issues you have found earlier (filed as WORDSJAVA-2152) have been fixed in this Aspose.Words for .NET 21.3 update and this Aspose.Words for Java 21.3 update.