Avoid NPE when handling color-highlighting in text-runs

This commit is contained in:
Dominik Stadler 2026-01-11 20:12:33 +01:00
parent 18ef01295d
commit 8cdcda2873

View File

@ -191,6 +191,10 @@ public class XSLFTextRun implements TextRun, HighlightColorSupport {
}
final CTSRgbColor rgbCol = col.getSrgbClr();
if (rgbCol == null) {
return;
}
final byte[] cols = rgbCol.getVal();
final SolidPaint paint = DrawPaint.createSolidPaint(new Color(0xFF & cols[0], 0xFF & cols[1], 0xFF & cols[2]));
highlightColor.accept(paint);