소스 검색

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