Getting Null pointer exception while inserting png image into word document

Getting Null pointer exception while inserting png image into word document.

java.lang.NullPointerException: null
at com.aspose.words.DocumentBuilder.zzY(Unknown Source) ~[aspose-words-16.11.0-jdk16.jar:16.11.0.0]
at com.aspose.words.zzYWK.endTable(Unknown Source) ~[aspose-words-16.11.0-jdk16.jar:16.11.0.0]
at com.aspose.words.DocumentBuilder.endTable(Unknown Source) ~[aspose-words-16.11.0-jdk16.jar:16.11.0.0]

Using Aspose word version 16.11.0.0

@jai25 Could you please attach the problematic image here for testing? We will check the issue and provide you more information.

Adding image
Example.png (544 Bytes)

@jai25 Thank you for additional information. Unfortunately, I cannot reproduce the problem on my side using the latest 23.4 version of Aspose.Words. For following code works fine on my side:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertImage("C:\\Temp\\Example.png");
doc.save("C:\\Temp\\out.docx");

Sorry not with image it’s related to some other thing but I can’t share it with you.

com.aspose.words.DocumentBuilder.zzY
com.aspose.words.zzYWK.endTable
com.aspose.words.DocumentBuilder.endTable

could you please confirm above will support in aspose word java version 16.11.0

@jai25 I have tested with 16.11 version and the code works fine.