-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DYN-6397 Fix crash when parent node is deleted while node autocomplete menu is displayed #14715
Changes from 32 commits
56ba101
dc250de
1fecd29
90a6c41
64c202b
d6ac751
255feeb
4e55f7f
1886669
8ac6b74
41c461c
f9cf237
a0adaef
2ab3d49
558df01
efdb82b
9b712f2
7c2dc1e
83bcb52
30b861d
71d23c2
cd1c4f9
0cae237
a588d14
45eddb0
4cfc270
579b3f1
fba8e45
f7c3fcd
69afd3e
35d997b
4636c6d
e1dbf02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,8 @@ public bool DisplayLowConfidence | |
} | ||
} | ||
|
||
internal event Action<NodeModel> ParentNodeRemoved; | ||
|
||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
|
@@ -530,6 +532,7 @@ internal void PopulateAutoCompleteCandidates() | |
{ | ||
if (PortViewModel == null) return; | ||
|
||
dynamoViewModel.CurrentSpaceViewModel.Model.NodeRemoved += NodeViewModel_Removed; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any place I can unsubscribe to this? I see that ViewModel has no property that can denote that the autocomplete menu is closed. May have to add it for this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One way is to pop the event all the way to DynamoViewModel level? |
||
ResetAutoCompleteSearchViewState(); | ||
|
||
if (IsDisplayingMLRecommendation) | ||
|
@@ -595,6 +598,16 @@ internal void PopulateDefaultAutoCompleteCandidates() | |
} | ||
} | ||
|
||
internal void OnNodeAutoCompleteWindowClosed() | ||
{ | ||
dynamoViewModel.CurrentSpaceViewModel.Model.NodeRemoved -= NodeViewModel_Removed; | ||
} | ||
|
||
internal void NodeViewModel_Removed(NodeModel node) | ||
{ | ||
ParentNodeRemoved?.Invoke(node); | ||
} | ||
|
||
/// <summary> | ||
/// Returns a IEnumberable of NodeSearchElementViewModel for respective NodeSearchElements. | ||
/// </summary> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the ViewModel could be null here
https://master-5.jenkins.autodesk.com/job/Dynamo/job/DynamoSelfServe/job/pullRequestValidation/12457/testReport/Dynamo.Tests/WorkspaceOpeningTests/ClearingWorkspaceResetsPositionAndZoom/