Browse Source

FX: fix null access on customAnims

lviguier 7 months ago
parent
commit
d18abb057e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      hrt/prefab/fx/FX.hx

+ 4 - 1
hrt/prefab/fx/FX.hx

@@ -91,8 +91,11 @@ class FXAnimation extends h3d.scene.Object {
 	}
 
 	public function updateCustomAnims(root : Prefab) {
+		if (customAnims == null)
+			customAnims = [];
 		hrt.prefab.fx.BaseFX.BaseFXTools.getCustomAnimations(root, customAnims, null);
-		if(customAnims.length == 0) customAnims = null;
+		if(customAnims.length == 0)
+			customAnims = null;
 		else {
 			for (a in customAnims) {
 				a.parameters = evaluator.parameters;