From 72b6211c6fcb5a5ab2a53bdf83afeee3584c039e Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Wed, 3 Aug 2011 00:19:38 +0000 Subject: [PATCH] SDK : fixed NPE in colorRGBADIalog introduced by previous change git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7973 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../materials/multiview/widgets/ColorRGBADialog.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java index c1ead2eb3..ac32fc31a 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java @@ -165,10 +165,12 @@ public class ColorRGBADialog extends javax.swing.JDialog { } public void setColor(Color color) { - this.color = color; - jColorChooser1.setColor(color); - - alphaSlider.setValue((int) ((float) (color.getAlpha() / 255f) * 100)); + if (color != null) { + this.color = color; + jColorChooser1.setColor(color); + + alphaSlider.setValue((int) ((float) (color.getAlpha() / 255f) * 100)); + } } }