Browse Source

Merge pull request #898 from PixiEditor/fixes/16.04.2025

Fixes/16.04.2025
Krzysztof Krysiński 3 months ago
parent
commit
577e40a679

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

@@ -39,7 +39,14 @@ public class InputProperty : IInputProperty
 
 
             if (!ValueType.IsAssignableTo(typeof(Delegate)) && connectionValue is Delegate connectionField)
             if (!ValueType.IsAssignableTo(typeof(Delegate)) && connectionValue is Delegate connectionField)
             {
             {
-                return connectionField.DynamicInvoke(FuncContext.NoContext);
+                try
+                {
+                    return connectionField.DynamicInvoke(FuncContext.NoContext);
+                }
+                catch
+                {
+                    return null;
+                }
             }
             }
 
 
             if (ValueType.IsAssignableTo(typeof(Delegate)) && connectionValue is not Delegate)
             if (ValueType.IsAssignableTo(typeof(Delegate)) && connectionValue is not Delegate)
@@ -217,7 +224,7 @@ public class InputProperty : IInputProperty
         HashCode hash = new();
         HashCode hash = new();
         hash.Add(InternalPropertyName);
         hash.Add(InternalPropertyName);
         hash.Add(ValueType);
         hash.Add(ValueType);
-        if(Value is ICacheable cacheable)
+        if (Value is ICacheable cacheable)
         {
         {
             hash.Add(cacheable.GetCacheHash());
             hash.Add(cacheable.GetCacheHash());
         }
         }

+ 2 - 0
src/PixiEditor/ViewModels/Document/DocumentViewModel.cs

@@ -1113,6 +1113,8 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
         int firstFrame = 0;
         int firstFrame = 0;
         int lastFrame = AnimationDataViewModel.GetVisibleFramesCount();
         int lastFrame = AnimationDataViewModel.GetVisibleFramesCount();
 
 
+        lastFrame = Math.Max(1, lastFrame);
+
         if (keyFrames.Count > 0)
         if (keyFrames.Count > 0)
         {
         {
             firstFrame = AnimationDataViewModel.GetFirstVisibleFrame();
             firstFrame = AnimationDataViewModel.GetFirstVisibleFrame();