package org.apache.poi.hwpf.model; public class ListTables When the "level" index is greater to the lst.numLevels() we got an array out of bound exception: Proposed change is : public ListLevel getLevel(int listID, int level) { ListData lst = (ListData)_listMap.get(new Integer(listID)); if (level < lst.numLevels()) { ListLevel lvl = lst.getLevels()[level]; return lvl; } else { return null; } }
Do you have a sample file that shows up this problem, that you could attach to the bug?
Created attachment 20445 [details] This "corrupted" WORD 2000 file leads to an "array out of bound" exception Trying to sort out where the problem would be in the MS WORD input file, I discovered that the WORD document was stated as "corrupted" by MS WORD when opening it. I understand that the proposed solution does not correct the root cause of the problem, but only tries to avoid an exception which does not retrieve the kind of data I wanted to extract from the MS WORD file.
Proposed patch applied