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

Free Support Forum - aspose.com

Save comments throws out NULLReferenceException

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);
comment.Paragraphs.Add(new Paragraph(doc));
comment.FirstParagraph.Runs.Add(new Run(doc, "Comment text."));

When I tried to save, it threw out an excption.Please help. Thanks.
BTW, I am using on .Net 2.0
William Ren

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.

When do you expect to release a hot fix?
William Ren

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

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

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.

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