Bug 40036 - TextBox throws NullPointerException
Summary: TextBox throws NullPointerException
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2006-07-13 10:00 UTC by Erez
Modified: 2006-09-26 08:50 UTC (History)
0 users

an example of an "empty" TextBox (11.50 KB, application/vnd.ms-powerpoint)
2006-07-13 10:02 UTC, Erez

Note You need to log in before you can comment on or make changes to this bug.
Description Erez 2006-07-13 10:00:33 UTC
TextBox throws NullPointerException in the following scenario:

I create a new .ppt file using PowerPoint, with an empty textbox in it (that 
says: "click to add text"), and than create an instance of Slide, and call the 
getShapes() method (some of the shapes are TextBox instances).

This causes the TextBox class to throw NullPointerExceptions, in methods 
getText(), setSheet(), because the mebmer _txtrun is null.
Comment 1 Erez 2006-07-13 10:02:06 UTC
Created attachment 18597 [details]
an example of an "empty" TextBox
Comment 2 Nick Burch 2006-09-26 15:50:18 UTC
I've added a fix, so you'll no longer get an NPE

However, until we add code to add in the text related record that your TextBox
is missing, the TextBox is going to be fairly useless.