Hi Team,
I attempted to save a document using the following code, but it encountered an exception. How can I effectively handle this exception? Please provide guidance.
Document document = new Document("Input.docx");
document.save("output.docx", SaveFormat.DOCX);
Exception:
Exception in thread “main” java.lang.NullPointerException: Cannot read the array length because “<parameter1>” is null
at com.aspose.words.zzWH.zzXsO(Unknown Source)
at com.aspose.words.zzZPU.zzZl5(Unknown Source)
at com.aspose.words.zzYhB.zzXsO(Unknown Source)
at com.aspose.words.zzYbs.visitShapeStart(Unknown Source)
at com.aspose.words.Shape.acceptStart(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Shape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.zzYbs.zzJc(Unknown Source)
at com.aspose.words.zzYbs.zzYBZ(Unknown Source)
at com.aspose.words.zzYbs.visitGroupShapeEnd(Unknown Source)
at com.aspose.words.GroupShape.acceptEnd(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.GroupShape.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Paragraph.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Body.accept(Unknown Source)
at com.aspose.words.zzYbs.zzXQ4(Unknown Source)
at com.aspose.words.zzWvx.zzXEG(Unknown Source)
at com.aspose.words.zzWvx.zzSL(Unknown Source)
at com.aspose.words.zzYbs.zzYP5(Unknown Source)
at com.aspose.words.zzX1R.zzXz8(Unknown Source)
at com.aspose.words.zzX1R.zzXsO(Unknown Source)
at com.aspose.words.zzW68.zzXsO(Unknown Source)
at com.aspose.words.Document.zzVQb(Unknown Source)
at com.aspose.words.Document.zzXsO(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
Regards,
Mahi