Avoid NPE in XSLFDiagram

Throw IllegalStateException instead

Fixes https://issues.oss-fuzz.com/issues/476184825
This commit is contained in:
Dominik Stadler 2026-01-18 17:23:42 +01:00
parent beab88fb0e
commit d1f0a88ea1
3 changed files with 4 additions and 0 deletions

View File

@ -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.