https://issues.apache.org/bugzilla/show_bug.cgi?id=44916

           Summary: HSSFSheet instance, getDrawingPatriarch
                    NullPointerException
           Product: POI
           Version: 3.0
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


In POI 3.0.2-FINAL:

After creating a drawing patriarch on a sheet, retrieving the patriarch via the
"getDrawingPatriarch" method may cause a NullPointerException, due to an unset,
unchecked rawData value in AbstractEscherHolderRecord.

"convertRawBytesToEscherRecords()" Line 99:
  convertToEscherRecords(0, rawData.length, rawData);
                               ^
                               |- Not checked for null, causes NPE

To reproduce:
1. Create drawing patriarch
  HSSFPatriarch patr = sheet.createDrawingPatriarch();

2. Use patriarch
  HSSFClientAnchor anchor = new HSSFClientAnchor(0,0, 600,245, (short)1,1,
(short)1,2);
  anchor.setAnchorType(3);
  patr.createPicture(anchor, loadImage(LOGO_PATH,
HSSFWorkbook.PICTURE_TYPE_JPEG));

3. Try to re-use patriarch later
  HSSFPatriarch existingPatr = sheet.getDrawingPatriarch();

4. Kaboom.


-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to