Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding Null Pointer check #53
Function ctPageBreak.getVal() (https://github.com/apache/poi/blob/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java#L824) returns null in some cases. So adding Null Pointer check.
To reproduce the issue, use the attached docx file (sample.docx) and run below code:
Function para.isEmpty() will throw NPE.
Thanks for the pull request and unit test. I didn't include your unit test or sample document in our unit test suite because it's a simple NPE. There weren't any other issues uncovered by the integration testing (org.apache.poi.stress.XWPFFileHandler(document/github53.docx)) with this file.
I also took the opportunity to change isPageBreak to work for all of the boolean-like value: "true", "1", "on", "false", "0", "off".
These changes will be included in POI 3.17 beta 1.