瀏覽代碼

FX: fix null access on customAnims

lviguier 7 月之前
父節點
當前提交
d18abb057e
共有 1 個文件被更改,包括 4 次插入1 次删除
  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;