Bug 63498

Summary: [PATCH] NPE when calling getShapeName on XSLFTableCell
Product: POI Reporter: Mate Borcsok <bmateusz>
Component: XSLFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 4.0.x-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Fix in XSLFShape.java and a test for it

Description Mate Borcsok 2019-06-12 13:32:26 UTC
Created attachment 36622 [details]
Fix in XSLFShape.java and a test for it

Calling getCNvPr() on a TableCell returns null, then we call .getName() on it without checking it.
Please see my patch and test case. I re-used table_test.pptx from the test-data.

I'm not sure if returning null is correct, but still better than an NPE.
Comment 1 PJ Fanning 2019-06-12 17:14:18 UTC
getShapeId id not null safe either

I'm not sure if it is meant to be valid to have XLSFShape that has no underlying XMLBean shape object.
Comment 2 PJ Fanning 2019-06-12 17:33:11 UTC
Comment on attachment 36622 [details]
Fix in XSLFShape.java and a test for it

I added https://svn.apache.org/viewvc?view=revision&revision=1861172
Comment 3 Dominik Stadler 2019-06-20 11:15:18 UTC
This is fixed according to the previous comment.