diff --git a/engine/src/core/com/jme3/animation/Animation.java b/engine/src/core/com/jme3/animation/Animation.java index a0999f260..a910d1362 100644 --- a/engine/src/core/com/jme3/animation/Animation.java +++ b/engine/src/core/com/jme3/animation/Animation.java @@ -168,7 +168,13 @@ public class Animation implements Savable, Cloneable { length = in.readFloat("length", 0f); Savable[] arr = in.readSavableArray("tracks", null); - tracks = new Track[arr.length]; - System.arraycopy(arr, 0, tracks, 0, arr.length); + if (arr != null) { + // NOTE: Backward compat only .. Some animations have no + // tracks set at all even though it makes no sense. + // Since there's a null check in setTime(), + // its only appropriate that the check is made here as well. + tracks = new Track[arr.length]; + System.arraycopy(arr, 0, tracks, 0, arr.length); + } } }