Bug 50075 - NullPointerException at ListLevel.getNumberText() when numberText is null
Summary: NullPointerException at ListLevel.getNumberText() when numberText is null
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: 3.7-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-11 15:09 UTC by Viliam Anirud
Modified: 2010-10-14 06:31 UTC (History)
0 users



Attachments
Patch to fix the bug with testcase (545 bytes, patch)
2010-10-11 15:21 UTC, Viliam Anirud
Details | Diff
New files not included in the diff (16.43 KB, application/octet-stream)
2010-10-11 15:21 UTC, Viliam Anirud
Details

Note You need to log in before you can comment on or make changes to this bug.
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