Explorar o código

Fixed broken delete node oppsie

flabbet hai 1 ano
pai
achega
62679c280c

+ 4 - 2
src/PixiEditor.ChangeableDocument/Changes/NodeGraph/DeleteNode_Change.cs

@@ -14,7 +14,7 @@ internal class DeleteNode_Change : Change
 
 
     private Node savedCopy;
     private Node savedCopy;
     
     
-    private GroupKeyFrame savedKeyFrameGroup;
+    private GroupKeyFrame? savedKeyFrameGroup;
 
 
     [GenerateMakeChangeAction]
     [GenerateMakeChangeAction]
     public DeleteNode_Change(Guid nodeId)
     public DeleteNode_Change(Guid nodeId)
@@ -38,9 +38,11 @@ internal class DeleteNode_Change : Change
         return true;
         return true;
     }
     }
 
 
-    public static GroupKeyFrame CloneGroupKeyFrame(Document target, Guid id)
+    public static GroupKeyFrame? CloneGroupKeyFrame(Document target, Guid id)
     {
     {
         GroupKeyFrame group = target.AnimationData.KeyFrames.FirstOrDefault(x => x.TargetNode.Id == id) as GroupKeyFrame;
         GroupKeyFrame group = target.AnimationData.KeyFrames.FirstOrDefault(x => x.TargetNode.Id == id) as GroupKeyFrame;
+        if (group is null)
+            return null;
         return group.Clone() as GroupKeyFrame;
         return group.Clone() as GroupKeyFrame;
     }
     }