From 68ace33dbd9e0e9630d5aa54cc11296fa82270a2 Mon Sep 17 00:00:00 2001 From: Paul Speed Date: Mon, 28 Mar 2016 11:06:29 -0400 Subject: [PATCH] Fixed an NPE when jmeClone() was asked to clone a null. --- jme3-core/src/main/java/com/jme3/util/clone/Cloner.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java b/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java index ba202e463..4b812006f 100644 --- a/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java +++ b/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java @@ -354,6 +354,9 @@ public class Cloner { * clone() and objects without necessarily knowing their real type.

*/ public T javaClone( T object ) throws CloneNotSupportedException { + if( object == null ) { + return null; + } Method m = methodCache.get(object.getClass()); if( m == null ) { try {