Avoid NPE with broken files when handling paint-style for fill

This commit is contained in:
Dominik Stadler 2026-01-07 19:32:26 +01:00
parent ac989335d7
commit befc941dcf
3 changed files with 6 additions and 1 deletions

View File

@ -244,7 +244,12 @@ public final class HSLFFill {
if (!FILL_USE_FILLED.isSet(propVal) && masterProp != null) {
int masterId = masterProp.getPropertyValue();
HSLFShape o = shape.getSheet().getMasterSheet().getShapes().stream().filter(s -> s.getShapeId() == masterId).findFirst().orElse(null);
HSLFMasterSheet masterSheet = shape.getSheet().getMasterSheet();
if (masterSheet == null) {
return null;
}
HSLFShape o = masterSheet.getShapes().stream().filter(s -> s.getShapeId() == masterId).findFirst().orElse(null);
return o != null ? o.getFillStyle().getPaint() : null;
}

Binary file not shown.