poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r1299336 - /poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java
Date Sun, 11 Mar 2012 07:14:16 GMT
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


Mime
View raw message