Преглед изворни кода

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);