浏览代码

Improved input property value getting

Krzysztof Krysiński 6 月之前
父节点
当前提交
f3f56ddd9d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/PixiEditor.ChangeableDocument/Changeables/Graph/InputProperty.cs

+ 2 - 2
src/PixiEditor.ChangeableDocument/Changeables/Graph/InputProperty.cs

@@ -42,7 +42,7 @@ public class InputProperty : IInputProperty
                 return FuncFactory(connectionValue);
             }
 
-            if (connectionValue.GetType() == ValueType)
+            if (connectionValue.GetType().IsAssignableTo(ValueType))
             {
                 return connectionValue;
             }
@@ -60,7 +60,7 @@ public class InputProperty : IInputProperty
 
             if (!ConversionTable.TryConvert(target, ValueType, out object result))
             {
-                return target;
+                return null;
             }
 
             return Validator.GetClosestValidValue(result);