Ver Fonte

Fixed node lookup crash

Krzysztof Krysiński há 2 dias atrás
pai
commit
df2b752011

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