Explorar o código

Fixed node lookup crash

Krzysztof Krysiński hai 2 días
pai
achega
df2b752011
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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;
         });