Skip to content

Commit f9d2e03

Browse files
stephengoldpspeed42
authored andcommitted
Mesh: avoid NPE in getMorphTargets() when there are no targets (jMonkeyEngine#1231)
1 parent 8905b3d commit f9d2e03

File tree

1 file changed

+5
-1
lines changed
  • jme3-core/src/main/java/com/jme3/scene

1 file changed

+5
-1
lines changed

jme3-core/src/main/java/com/jme3/scene/Mesh.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,11 @@ public void addMorphTarget(MorphTarget target) {
15271527
}
15281528

15291529
public MorphTarget[] getMorphTargets() {
1530-
return morphTargets.getArray();
1530+
if (morphTargets == null) {
1531+
return new MorphTarget[0];
1532+
} else {
1533+
return morphTargets.getArray();
1534+
}
15311535
}
15321536

15331537
/**

0 commit comments

Comments
 (0)