瀏覽代碼

Fixed node lookup crash

Krzysztof Krysiński 2 天之前
父節點
當前提交
df2b752011
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/PixiEditor/ViewModels/Document/NodeGraphViewModel.cs

+ 4 - 2
src/PixiEditor/ViewModels/Document/NodeGraphViewModel.cs

@@ -161,8 +161,10 @@ internal class NodeGraphViewModel : ViewModelBase, INodeGraphHandler, IDisposabl
             if (x is not IPairNodeStartViewModel)
                 return Traverse.Further;
 
-            var zone = startLookup[x];
-            currentlyPartOf.Add(zone);
+            if (startLookup != null && startLookup.TryGetValue(x, out var zone))
+            {
+                currentlyPartOf.Add(zone);
+            }
 
             return Traverse.Further;
         });