Bug 50075

Summary: NullPointerException at ListLevel.getNumberText() when numberText is null
Product: POI Reporter: Viliam Anirud <a6537691>
Component: HWPFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.7-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch to fix the bug with testcase
New files not included in the diff

Description Viliam Anirud 2010-10-11 15:09:33 UTC
When the document contains numbered paragraph with no number (strange, but real), reading NumberText from that ListLevel fails with following exception:

java.lang.NullPointerException
	at java.lang.String.<init>(String.java:177)
	at org.apache.poi.hwpf.model.ListLevel.getNumberText(ListLevel.java:209)
	at dird.dokument.parser.ListUtils.getFormattedNumber(ListUtils.java:88)
	...

In the constructor, when the numberTextLength is 0, it initializes _numberText to null. I will upload a patch with a test case.
Comment 1 Viliam Anirud 2010-10-11 15:21:21 UTC
Created attachment 26154 [details]
Patch to fix the bug with testcase
Comment 2 Viliam Anirud 2010-10-11 15:21:44 UTC
Created attachment 26155 [details]
New files not included in the diff
Comment 3 Yegor Kozlov 2010-10-14 06:31:35 UTC
Applied in r1022456

Yegor