Browse Source

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

Stephen Gold 4 years ago
parent
commit
befaca78a5
1 changed files with 4 additions and 4 deletions
  1. 4 4
      jme3-core/src/main/java/com/jme3/anim/TransformTrack.java

+ 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();
     }