Forráskód Böngészése

TransformTrack: add null checks to getTranslations() and getRotations() (#1532)

Stephen Gold 4 éve
szülő
commit
4ec83aa611

+ 4 - 4
jme3-core/src/main/java/com/jme3/anim/TransformTrack.java

@@ -83,10 +83,10 @@ public class TransformTrack implements AnimTrack<Transform> {
     /**
      * return the array of rotations of this track
      *
-     * @return an array
+     * @return an array, or null if no rotations
      */
     public Quaternion[] getRotations() {
-        return rotations.toObjectArray();
+        return rotations == null ? null : rotations.toObjectArray();
     }
 
     /**
@@ -110,10 +110,10 @@ public class TransformTrack implements AnimTrack<Transform> {
     /**
      * returns the array of translations of this track
      *
-     * @return an array
+     * @return an array, or null if no translations
      */
     public Vector3f[] getTranslations() {
-        return translations.toObjectArray();
+        return translations == null ? null : translations.toObjectArray();
     }