From 8d9d09157622fa2d496e31ff0171ef839c4eff60 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Mon, 9 Dec 2019 07:39:30 -0800 Subject: [PATCH] Mesh: avoid NPE in getMorphTargets() when there are no targets (#1231) --- jme3-core/src/main/java/com/jme3/scene/Mesh.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/scene/Mesh.java b/jme3-core/src/main/java/com/jme3/scene/Mesh.java index 1e3195e00..326a6acc7 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Mesh.java +++ b/jme3-core/src/main/java/com/jme3/scene/Mesh.java @@ -1527,7 +1527,11 @@ public class Mesh implements Savable, Cloneable, JmeCloneable { } public MorphTarget[] getMorphTargets() { - return morphTargets.getArray(); + if (morphTargets == null) { + return new MorphTarget[0]; + } else { + return morphTargets.getArray(); + } } /**