Free Support Forum - aspose.com

Update Fields in Word Document after Building Page Layout - Manage System.NullReferenceException in C# .NET

Hi,

We have an issue with one document (see issue.zip (164 Bytes)
) - when trying to use with Aspose.Words. It used to work with version 19.11, but does not since 19.12.

When we call UpdatePageLayout and then UpdateFields on a Document, it throws “Object reference not set to an instance of an object” exception.

Code sample:

        var document = new Document(@"...\issue.docx");
        document.UpdatePageLayout();
        document.UpdateFields();

Can you advise?

Thanks,
Lukasz

Hi,

See also another document that worked with version 19.11, but is broken since 19.12.
issue2.zip (16.7 KB)

Thanks,
Lukasz

@acturisaspose,

We tested the above scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19813. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Regarding the issue.zip that you attached with your first post appears to be empty; can you please re-attach it here for further testing?

@awais.hafeez,

Sure, I am attaching issue.zip (60.7 KB)

Could you please tell me if there is any workaround for the issue? It is important for us, especially that it was working on 19.11.

Thank you,
Lukasz

@acturisaspose,

We have logged another issue for this document. The ID of this issue is WORDSNET-19819.

We will inform you when any ETA or any workaround may be available in future. Sorry for the inconvenience.

Are you able to shed some light how did this fatal error sneak into the production release?

@acturisaspose,

We exercise unit testing and all of our unit tests are properly structured. Therefore, upgrading to the latest version of Aspose.Words is safe and the latest version should cause no undesired behavior. The regression issues that you reported recently only happen in rare cases like yours. We apologize that the functionality is broken in latest version of Aspose.Words. We are investigating them and will keep you posted on further updates.

@acturisaspose,

We have good news for you i.e. both the linked issues WORDSNET-19813 and WORDSNET-19819 have now been resolved. The fixes of these issues will be included in the 20.2 (next version) of Aspose.Words. We will inform you via this thread as soon as the next version containing the fixes of your issues will be released at the start of next month.

The issues you have found earlier (filed as WORDSNET-19813) have been fixed in this Aspose.Words for .NET 20.2 update and this Aspose.Words for Java 20.2 update.

The issues you have found earlier (filed as WORDSNET-19819) have been fixed in this Aspose.Words for .NET 20.2 update and this Aspose.Words for Java 20.2 update.