mirror of
https://github.com/apache/poi.git
synced 2026-02-27 12:30:08 +08:00
Avoid NPE in XSLFDiagram
Throw IllegalStateException instead Fixes https://issues.oss-fuzz.com/issues/476184825
This commit is contained in:
parent
beab88fb0e
commit
d1f0a88ea1
@ -181,6 +181,10 @@ public class XSLFDiagram extends XSLFGraphicFrame {
|
||||
textShapeCT.setNvSpPr((CTShapeNonVisual) nonVisualCt.copy());
|
||||
textShapeCT.getNvSpPr().getCNvSpPr().setTxBox(true);
|
||||
|
||||
if (msShapeCt.getSpPr() == null || msShapeCt.getSpPr().getXfrm() == null || msShapeCt.getTxXfrm() == null) {
|
||||
throw new IllegalStateException("Invalid content in diagram, cannot extract text");
|
||||
}
|
||||
|
||||
textShapeProps.setXfrm(msShapeCt.getTxXfrm());
|
||||
int shapeRotation = msShapeCt.getSpPr().getXfrm().getRot();
|
||||
int textRotation = msShapeCt.getTxXfrm().getRot();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user