SDK : fixed NPE in colorRGBADIalog introduced by previous change

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7973 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 14 years ago
parent 354fab834e
commit 72b6211c6f
  1. 10
      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));
}
}
}

Loading…
Cancel
Save