* Fixed issue where an ogre3d animation with no tracks would load, but cause a NPE when loaded again from J3O
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9317 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
ad01d36915
commit
c8fa79fbd6
@ -168,7 +168,13 @@ public class Animation implements Savable, Cloneable {
|
|||||||
length = in.readFloat("length", 0f);
|
length = in.readFloat("length", 0f);
|
||||||
|
|
||||||
Savable[] arr = in.readSavableArray("tracks", null);
|
Savable[] arr = in.readSavableArray("tracks", null);
|
||||||
|
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];
|
tracks = new Track[arr.length];
|
||||||
System.arraycopy(arr, 0, tracks, 0, arr.length);
|
System.arraycopy(arr, 0, tracks, 0, arr.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user