diff --git a/engine/src/core/com/jme3/scene/Spatial.java b/engine/src/core/com/jme3/scene/Spatial.java index b4157ab55..1d0babcbc 100644 --- a/engine/src/core/com/jme3/scene/Spatial.java +++ b/engine/src/core/com/jme3/scene/Spatial.java @@ -1215,7 +1215,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab userData = new HashMap(); } - if (data instanceof Savable) { + if(data == null){ + userData.remove(key); + }else if (data instanceof Savable) { userData.put(key, (Savable) data); } else { userData.put(key, new UserData(UserData.getObjectType(data), data));