diff --git a/jme3-core/src/main/java/com/jme3/scene/Spatial.java b/jme3-core/src/main/java/com/jme3/scene/Spatial.java index 452ccce47..aa4c80298 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Spatial.java +++ b/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.addAll(0, ic.readSavableArrayList("controlsList", null)); + // remove all controls which wasn't loaded. + for (Iterator iterator = controls.iterator(); iterator.hasNext(); ) { + final Control control = iterator.next(); + if(control == null) iterator.remove(); + } + userData = (HashMap) ic.readStringSavableMap("user_data", null); }