Bug 63498 - [PATCH] NPE when calling getShapeName on XSLFTableCell
Summary: [PATCH] NPE when calling getShapeName on XSLFTableCell
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 4.0.x-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-12 13:32 UTC by Mate Borcsok
Modified: 2019-06-20 11:15 UTC (History)
0 users



Attachments
Fix in XSLFShape.java and a test for it (2.17 KB, patch)
2019-06-12 13:32 UTC, Mate Borcsok
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.