diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java b/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java index 88c0b19fd..ef4c4c8a6 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java @@ -381,10 +381,11 @@ public abstract class Shape { boolean fSchemeIndex = (a & (1 << 3)) != 0; boolean fSysIndex = (a & (1 << 4)) != 0; - if (fSchemeIndex) + Sheet sheet = getSheet(); + if (fSchemeIndex && sheet != null) { //red is the index to the color scheme - ColorSchemeAtom ca = getSheet().getColorScheme(); + ColorSchemeAtom ca = sheet.getColorScheme(); int schemeColor = ca.getColor(r); r = (schemeColor >> 0) & 0xFF;