Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Adding Null Pointer check #53
Conversation
prafulVaishnav
commented
May 12, 2017
•
|
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. @tballison @poi-benchmark Please review and merge. |
onealj
commented
May 12, 2017
|
Possible side-note, but shouldn't we be checking that the value isn't any of the true-like string values that OOXML STOnOff allows: "true", "1", or "on"? |
asfgit
closed this
in fac98b5
May 16, 2017
onealj
commented
May 16, 2017
|
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. r1795254 https://svn.apache.org/viewvc?view=revision&revision=1795254 |
prafulVaishnav commentedMay 12, 2017
No description provided.