We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save comments throws out NULLReferenceException

Hello,

I download latest Aspose.Words and use your demo code to test comment function. The code is as below:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Some text is added.");

Comment comment = new Comment(doc);
builder.CurrentParagraph.AppendChild(comment);
comment.Paragraphs.Add(new Paragraph(doc));
comment.FirstParagraph.Runs.Add(new Run(doc, "Comment text."));

doc.Save("c:\\test.doc");

When I tried to save, it threw out an excption.Please help. Thanks.

BTW, I am using 5.1.0.0 on .Net 2.0

William Ren

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for reporting this.

I have reproduced a NullReferenceException using this code sample and logged the issue as #4963 in our defect database. We’ll investigate it and either provide more information or fix the case.

Regards,

Hi,

When do you expect to release a hot fix?

William Ren

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please expect a reply before next hotfix (within 2-3 weeks). We might just fix this issue or provide you more information.

Best regards.

Hi,

You released Aspose.Words 5.2.0 on May 15, but I cannot find this case #4963 in the fixes. When will you have it fixed? Thanks.

William Ren

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately this issue is unresolved yet. We will try to resolve this issue in our next release. But currently I can’t provide you exact date when this issue will be fixed. Thanks for your patience.

Best regards.

This is fixed in the next release that is coming out, but you can workaround now. Just set Comment.Author and Comment.Initial properties to non null values. Easy.

The issues you have found earlier (filed as 4346) have been fixed in this update.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The problem was caused by null author and initials. Changed defaults to empty strings.