Bug 47068 - Null pointer exception in SimpleShape.getClientRecords()
Summary: Null pointer exception in SimpleShape.getClientRecords()
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.5-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-21 16:10 UTC by Sean bridges
Modified: 2009-06-19 08:01 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean bridges 2009-04-21 16:10:43 UTC
This is with 3.5 beta 4

In getClientRecords(), the code,

EscherRecord r = Shape.getEscherChild(getSpContainer(), EscherClientDataRecord.RECORD_ID);
            //ddf can return EscherContainerRecord with recordId=EscherClientDataRecord.RECORD_ID
            //convert in to EscherClientDataRecord on the fly
            if(!(r instanceof EscherClientDataRecord)){

getEscherChild(...) may return null, in which,

!(r instanceof EscherClientDataRecord)

is true, and 

byte[] data = r.serialize();

throws a NullPointerException

java.lang.NullPointerException
	at org.apache.poi.hslf.model.SimpleShape.getClientRecords(SimpleShape.java:322)
	at org.apache.poi.hslf.model.SimpleShape.getClientDataRecord(SimpleShape.java:307)
	at org.apache.poi.hslf.model.TextShape.getPlaceholderAtom(TextShape.java:547)
	at org.apache.poi.hslf.model.Sheet.getPlaceholder(Sheet.java:408)
	at org.apache.poi.hslf.model.HeadersFooters.isVisible(HeadersFooters.java:244)
	at org.apache.poi.hslf.model.HeadersFooters.isHeaderVisible(HeadersFooters.java:148)
	at org.apache.poi.hslf.extractor.PowerPointExtractor.getText(PowerPointExtractor.java:173)
	at org.apache.poi.hslf.extractor.PowerPointExtractor.getText(PowerPointExtractor.java:144)
Comment 1 Yegor Kozlov 2009-06-19 08:01:19 UTC
The problem was fixed in r746238 in February 2009.

Try the latest trunk, daily builds can be downloaded from http://encore.torchbox.com/poi-svn-build/

Yegor