Paragraphs inserted before/after table has no main part

Jan 30, 2016 at 9:24 AM
Edited Jan 30, 2016 at 9:25 AM
If you insert a paragraph by table.InsertParagraphBeforeSelf(), new paragraph's main part will be null, this will cause NRE if you will try insert picture into this paragraph

for example:
            DocX document = DocX.Create(resultFileName);

            Table table = document.AddTable(1, 1);

            Table newTable = document.InsertTable(table);
            Paragraph paragraph = newTable.InsertParagraphBeforeSelf("");
            //paragraph.PackagePart == null
            Image image = document.AddImage("SomeImageFile.jpg");
            Picture picture = image.CreatePicture();

            paragraph.InsertPicture(picture); //have NullReferenceException here
Developer
Feb 4, 2016 at 7:13 AM
Feel free to submit a fix :) I am gathering things up to build new release.