InsertHtml throws System.NullReferenceException

We recently upgraded from 11.2 to 15.10 and we are having many issues with html merging. The following example throws an unhandled exception on the first test (thisHtmlFails), however the next two tests work just fine. I have tested this in 15.12 and get the same results. What can we do to fix this issue?


DocumentBuilder doc = new DocumentBuilder(new Document(input)); // any document is fine

string thisHtmlFails = @"
  1. test

    ";
    doc.InsertHtml(thisHtmlFails, true);

    string thisHtmlWorks = @"
    1. x
    2. test

      ";
      doc.InsertHtml(thisHtmlWorks, true);

      string thisHtmlWorksToo = @"
      1. ";
        doc.InsertHtml(thisHtmlWorksToo, true);

        Hi Philip,


        Thanks for your inquiry. After an initial test with Aspose.Words for .NET 15.12.0, I was unable to reproduce this exception on my side. Please attach the following resources here for testing:

        • Your input Word document
        • Please create a standalone Console application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing…

        As soon as you get these pieces of information ready, we’ll start further investigation into your issue and provide you more information. Thanks for your cooperation.

        PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

        Best regards,

        Added zip file with included word document

        Hi Philip,


        Thanks for your inquiry.

        While using the latest version of Aspose.Words i.e. 15.12.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-13041. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

        Best regards,

        The issues you have found earlier (filed as WORDSNET-13041) have been fixed in this .NET update and this Java update.


        This message was posted using Notification2Forum from Downloads module by aspose.notifier.