Author: rwhitcomb
Date: Tue Oct 29 22:12:49 2013
New Revision: 1536913

URL: http://svn.apache.org/r1536913
Log:
PIVOT-689:  Protect against missing "themeIsDark" property in the theme 
definition.

Modified:
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java

Modified: 
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
URL: 
http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java?rev=1536913&r1=1536912&r2=1536913&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java 
(original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java 
Tue Oct 29 22:12:49 2013
@@ -188,7 +188,7 @@ public final class TerraTheme extends Th
         // Load the color scheme
         String location = null;
         try {
-            String locationKey = getClass().getPackage().getName() + "." + 
LOCATION_PROPERTY;
+            String locationKey = packageName + "." + LOCATION_PROPERTY;
             location = System.getProperty(locationKey);
         } catch (SecurityException exception) {
             // No-op
@@ -258,9 +258,15 @@ public final class TerraTheme extends Th
                 int numberOfColors = numberOfPaletteColors * 3;
                 colors = new ArrayList<>(numberOfColors);
 
-                colorMultiplier = ((Double) 
properties.get("colorMultiplier")).floatValue();
+                Double mult = (Double) properties.get("colorMultiplier");
+                if (mult != null) {
+                    colorMultiplier = mult.floatValue();
+                }
 
-                themeIsDark = ((Boolean) 
properties.get("themeIsDark")).booleanValue();
+                Boolean dark = (Boolean) properties.get("themeIsDark");
+                if (dark != null) {
+                    themeIsDark = dark.booleanValue();
+                }
 
                 for (String colorCode : colorCodes) {
                     Color baseColor = Color.decode(colorCode);


Reply via email to