File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
src/GraphNodeManagerViewExtension Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -286,14 +286,27 @@ internal void EnableEditing()
286286 internal void NodeSelect ( object obj )
287287 {
288288 var nodeViewModel = obj as GridNodeViewModel ;
289- if ( nodeViewModel == null ) return ;
289+ if ( nodeViewModel == null || nodeViewModel . NodeModel == null ) return ;
290290
291- // Select
292- var command = new DynamoModel . SelectModelCommand ( nodeViewModel . NodeModel . GUID , ModifierKeys . None ) ;
293- commandExecutive . ExecuteCommand ( command , uniqueId , "GraphNodeManager" ) ;
291+ try
292+ {
293+ // Select
294+ var command = new DynamoModel . SelectModelCommand ( nodeViewModel . NodeModel . GUID , ModifierKeys . None ) ;
295+ commandExecutive . ExecuteCommand ( command , uniqueId , "GraphNodeManager" ) ;
294296
295- // Focus on selected
296- viewModelCommandExecutive . FocusNodeCommand ( nodeViewModel . NodeModel . GUID . ToString ( ) ) ;
297+ // Focus on selected
298+ viewModelCommandExecutive . FocusNodeCommand ( nodeViewModel . NodeModel . GUID . ToString ( ) ) ;
299+ }
300+ catch
301+ {
302+ // Suppress exceptions from selection or focus commands.
303+ // Known failure scenarios include:
304+ // - Node not found (invalid GUID)
305+ // - UI not ready to process focus command
306+ // - Transient UI errors during command execution
307+ // These are intentionally ignored to prevent UI crashes or interruptions.
308+ return ;
309+ }
297310 }
298311
299312 /// <summary>
You can’t perform that action at this time.
0 commit comments