fixed the NPE with controls

cleanup_build_scripts
javasabr 9 years ago
parent 3d1a541903
commit f354343e47
  1. 6
      jme3-core/src/main/java/com/jme3/scene/Spatial.java

@ -1635,6 +1635,12 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
//controls = ic.readSavableArrayList("controlsList", null)); //controls = ic.readSavableArrayList("controlsList", null));
controls.addAll(0, ic.readSavableArrayList("controlsList", null)); controls.addAll(0, ic.readSavableArrayList("controlsList", null));
// remove all controls which wasn't loaded.
for (Iterator<Control> iterator = controls.iterator(); iterator.hasNext(); ) {
final Control control = iterator.next();
if(control == null) iterator.remove();
}
userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null); userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null);
} }

Loading…
Cancel
Save