You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/04/19 14:58:54 UTC
DO NOT REPLY [Bug 53107] New: NullPointer in AbstractWordUtils while
transforming doc in html
https://issues.apache.org/bugzilla/show_bug.cgi?id=53107
Bug #: 53107
Summary: NullPointer in AbstractWordUtils while transforming
doc in html
Product: POI
Version: 3.8
Platform: PC
Status: NEW
Severity: major
Priority: P2
Component: HWPF
AssignedTo: dev@poi.apache.org
ReportedBy: benoit.maggi@gmail.com
Classification: Unclassified
Hello,
I get a NullPointer while using poi in transforming doc in html.
The method getLevel (in ListTables) return a null while there is no null test
in AbstractWordUtils (there are other place with no test)
My temporary patch is to return an empty ListLevel (return new ListLevel();)
at the end of getLevel! The transformation works fine.
I don't know which one is the best practice :
- return an empty object ?
- test null after each call of getLevel(...) ?
Here some codes :
It comes from :
org.apache.poi.hwpf.converter.AbstractWordUtils L232 :
final ListLevel listLevel = listTables.getLevel( listId,
paragraph.getIlvl() );
if ( listLevel.getNumberText() == null )
return EMPTY;
org.apache.poi.hwpf.model.ListTables L224 :
public ListLevel getLevel(int listID, int level)
{
ListData lst = _listMap.get(Integer.valueOf(listID));
if(level < lst.numLevels()) {
ListLevel lvl = lst.getLevels()[level];
return lvl;
}
log.log(POILogger.WARN, "Requested level " + level + " which was greater
than the maximum defined (" + lst.numLevels() + ")");
return null;
}
Regards,
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53107] NullPointer in AbstractWordUtils while transforming doc
in html
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53107
Sergey Vladimirov <vl...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Sergey Vladimirov <vl...@gmail.com> ---
Benoit,
Could you please provide an example file, so we can check if error is still
present?
Sergey
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org