浏览代码

Fix custom output properties loading error

Leonardo Jeanteur 4 年之前
父节点
当前提交
6b44824a82
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      hrt/shgraph/ShaderOutput.hx

+ 8 - 1
hrt/shgraph/ShaderOutput.hx

@@ -86,12 +86,19 @@ class ShaderOutput extends ShaderNode {
 				return;
 			}
 		}
+		var type: Type;
+		try {
+			type = haxe.EnumTools.createByName(Type, paramVariable[1], paramVariable[2]);
+		} catch( e ) {
+			trace('Received invalid props for output node. id: $id, variable name: ${paramVariable[0]}');
+			return;
+		}
 		this.variable = {
 			parent: null,
 			id: 0,
 			kind: Local,
 			name: paramVariable[0],
-			type: haxe.EnumTools.createByName(Type, paramVariable[1], paramVariable[2]),
+			type: type,
 		};
 	}