small fic to prevent NPE when iterating over shape attributes in HSLF

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1299336 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2012-03-11 07:14:16 +00:00
parent 1434c766a3
commit 24d8e515b0

View File

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