NullPointer exception while adding svg image to shape text box

I am using aspose words java 23.5 version
If I try to add svg image type using builder.insertImage, it fails with nullpointer exception.
We need to add shape text box and then image as our shape can have text as well as image.

Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);
			
GroupShape group1 = new GroupShape(document);
group1.setBounds(new Rectangle2D.Float(0f, 0f, (float)builder.getPageSetup().getPageWidth(), (float)builder.getPageSetup().getPageHeight()));
group1.setCoordSize(new Dimension((int)builder.getPageSetup().getPageWidth(), (int)builder.getPageSetup().getPageHeight()));
group1.setCoordOrigin(new Point(0, 0));
document.getLastSection().getBody().getLastParagraph().appendChild(group1);
			
Shape shape = new Shape(document, ShapeType.TEXT_BOX);
Paragraph paragraph = new Paragraph(document);
Run run = new Run(document, "");
paragraph.appendChild(run);
shape.appendChild(paragraph);
			
builder.moveTo(run);
builder.insertImage("D:\\duke.svg");
			
shape.setTop(50);
shape.setLeft(20);
shape.setWidth(400);
shape.setHeight(200);
group1.appendChild(shape);
			
document.save("D:\\TestAsposeImage.docx");

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

svg_images.zip (27.9 KB)

Facing issues for both these svg images

@aishwarya12joshi the problem occurs because the created textbox is not added into the document. Please modify the code like the following to avoid the problem:

Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);

GroupShape group1 = new GroupShape(document);
group1.setBounds(new Rectangle2D.Float(0f, 0f, (float)builder.getPageSetup().getPageWidth(), (float)builder.getPageSetup().getPageHeight()));
group1.setCoordSize(new Dimension((int)builder.getPageSetup().getPageWidth(), (int)builder.getPageSetup().getPageHeight()));
group1.setCoordOrigin(new Point(0, 0));
document.getLastSection().getBody().getLastParagraph().appendChild(group1);

Shape shape = new Shape(document, ShapeType.TEXT_BOX);
group1.appendChild(shape); // <-------- put the shape into the document.
Paragraph paragraph = new Paragraph(document);
Run run = new Run(document, "");
paragraph.appendChild(run);
shape.appendChild(paragraph);

builder.moveTo(run);
builder.insertImage("C:\\Temp\\img1.svg");

shape.setTop(50);
shape.setLeft(20);
shape.setWidth(400);
shape.setHeight(200);

document.save("C:\\Temp\\out.docx");