I'm using docx4j in my pet project and I faced with some problem. During converting xhtml code to docx format I've got NullPointerException in some cases.
Test to reproduce issue:
import org.docx4j.wml.Text;
import org.docx4j.wml.R;
import org.docx4j.wml.P;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.List;
import org.docx4j.openpackaging.exceptions.Docx4JException;
import org.docx4j.openpackaging.exceptions.InvalidFormatException;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.junit.Test;
import static org.junit.Assert.*;
...
@Test public void testLoadingNonExistantImage() throws InvalidFormatException, FileNotFoundException, Docx4JException {
try {
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
String xhtml = "<?xml version=\"1.0\" ...