mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40: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.setNvSpPr((CTShapeNonVisual) nonVisualCt.copy());
|
||||||
textShapeCT.getNvSpPr().getCNvSpPr().setTxBox(true);
|
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());
|
textShapeProps.setXfrm(msShapeCt.getTxXfrm());
|
||||||
int shapeRotation = msShapeCt.getSpPr().getXfrm().getRot();
|
int shapeRotation = msShapeCt.getSpPr().getXfrm().getRot();
|
||||||
int textRotation = msShapeCt.getTxXfrm().getRot();
|
int textRotation = msShapeCt.getTxXfrm().getRot();
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user