Bug 51770 - NPE Parsing MS Word 12.0.0 XWPFPicture.getPictureData()
Summary: NPE Parsing MS Word 12.0.0 XWPFPicture.getPictureData()
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 3.8-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-06 13:05 UTC by pqueixalos
Modified: 2011-09-12 10:37 UTC (History)
0 users



Attachments
example file throwing this NPE (234.00 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2011-09-06 13:05 UTC, pqueixalos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pqueixalos 2011-09-06 13:05:41 UTC
Created attachment 27462 [details]
example file throwing this NPE

Tested with poi-3.8-beta4 (embed in Tika)

Caused by: java.lang.NullPointerException
at org.apache.poi.xwpf.usermodel.XWPFPicture.getPictureData(XWPFPicture.java:61)
at org.apache.tika.parser.microsoft.ooxml.XWPFWordExtractorDecorator.extractParagraph(XWPFWordExtractorDecorator.java:145)
at org.apache.tika.parser.microsoft.ooxml.XWPFWordExtractorDecorator.extractHeaderText(XWPFWordExtractorDecorator.java:231)
at org.apache.tika.parser.microsoft.ooxml.XWPFWordExtractorDecorator.extractHeaders(XWPFWordExtractorDecorator.java:225)
at org.apache.tika.parser.microsoft.ooxml.XWPFWordExtractorDecorator.buildXHTML(XWPFWordExtractorDecorator.java:43)
at org.apache.tika.parser.microsoft.ooxml.AbstractOOXMLExtractor.getXHTML(AbstractOOXMLExtractor.java:108)
at org.apache.tika.parser.microsoft.ooxml.OOXMLExtractorFactory.parse(OOXMLExtractorFactory.java:95)
at org.apache.tika.parser.microsoft.ooxml.OOXMLParser.parse(OOXMLParser.java:70)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
... 41 more
Comment 1 Yegor Kozlov 2011-09-12 10:37:30 UTC
Fixed in r1169679, junit added. XWPFPicture.getPictureData now gracefully returns null if picture data cannot be retrieved. 

Yegor