mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Avoid NPE with broken files when handling paint-style for fill
This commit is contained in:
parent
ac989335d7
commit
befc941dcf
@ -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;
|
||||
}
|
||||
|
||||
|
||||
BIN
test-data/slideshow/2100a8d44da546f97ab7795c500a58bed6cb655d.ppt
Normal file
BIN
test-data/slideshow/2100a8d44da546f97ab7795c500a58bed6cb655d.ppt
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user