Allow setAppearance to accept a null Appearance parameter without
throwing NPE.
This commit is contained in:
parent
f899b9fb2e
commit
173108c1a8
@ -426,17 +426,20 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
|
||||
*/
|
||||
public void setAppearance(Appearance appearance) {
|
||||
this.appearance = appearance;
|
||||
Decal d = this.appearance.getTexture();
|
||||
if (d != null) {
|
||||
d.getImage().addChangeListener(new StateChangeListener() {
|
||||
if (this.appearance != null) {
|
||||
Decal d = this.appearance.getTexture();
|
||||
if (d != null) {
|
||||
d.getImage().addChangeListener(new StateChangeListener() {
|
||||
|
||||
@Override
|
||||
public void stateChanged(EventObject e) {
|
||||
fireComponentChangeEvent(ComponentChangeEvent.TEXTURE_CHANGE);
|
||||
}
|
||||
@Override
|
||||
public void stateChanged(EventObject e) {
|
||||
fireComponentChangeEvent(ComponentChangeEvent.TEXTURE_CHANGE);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
// CHECK - should this be a TEXTURE_CHANGE and not NONFUNCTIONAL_CHANGE?
|
||||
fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user