You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2012/03/11 08:14:16 UTC
svn commit: r1299336 -
/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java
Author: yegor
Date: Sun Mar 11 07:14:16 2012
New Revision: 1299336
URL: http://svn.apache.org/viewvc?rev=1299336&view=rev
Log:
small fic to prevent NPE when iterating over shape attributes in HSLF
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java?rev=1299336&r1=1299335&r2=1299336&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java Sun Mar 11 07:14:16 2012
@@ -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;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org