Skip to content

DYN-6967 Crash when placing List selector archi-lab Dynamo nodes in canvas #15224

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

Merged
merged 5 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ Don't worry, you'll have the option to save your work.</value>
<value>_Select All</value>
<comment>Edit menu | Select all nodes</comment>
</data>
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<value>_Unpin All Preview Bubbles</value>
<comment>Edit menu | Unpin preview bubbles</comment>
</data>
Expand Down Expand Up @@ -3983,4 +3983,7 @@ To make this file into a new template, save it to a different folder, then move
<data name="MessagePackOlderDynamoLink" xml:space="preserve">
<value>#Learn more=https://primer2.dynamobim.org/1_developer_primer_intro/3_developing_for_dynamo/updating-your-packages-and-dynamo-libraries-for-dynamo-3x-net8</value>
</data>
</root>
<data name="NodeInCanvasSearchCreationError" xml:space="preserve">
<value>Failed to create node: </value>
</data>
</root>
7 changes: 5 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
<value>_Select All</value>
<comment>Edit menu | Select all nodes</comment>
</data>
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<value>_Unpin All Preview Bubbles</value>
<comment>Edit menu | Unpin preview bubbles</comment>
</data>
Expand Down Expand Up @@ -3970,4 +3970,7 @@ To make this file into a new template, save it to a different folder, then move
<data name="MessagePackOlderDynamoLink" xml:space="preserve">
<value>#Learn more=https://primer2.dynamobim.org/1_developer_primer_intro/3_developing_for_dynamo/updating-your-packages-and-dynamo-libraries-for-dynamo-3x-net8</value>
</data>
</root>
<data name="NodeInCanvasSearchCreationError" xml:space="preserve">
<value>Failed to create node: </value>
</data>
</root>
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4878,6 +4878,7 @@ static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeDescription.get -> stri
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeInput.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeOutput.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeType.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInCanvasSearchCreationError.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInfoDismissButtonToolTip.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInformationalStateDismiss.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInformationalStateDismissAll.get -> string
Expand Down
15 changes: 13 additions & 2 deletions src/DynamoCoreWpf/ViewModels/Search/NodeSearchElementViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,19 @@ protected virtual void OnClicked()
{
if (Clicked != null)
{
var nodeModel = Model.CreateNode();
Clicked(nodeModel, Position);
// Try to create the node based on the search element from in-Canvas search
// The node creation can fail if the node constructor dependencies are not found or other reasons.
// This is a best effort to create the node and log the error both in console and toast notification if it fails.
try
{
var nodeModel = Model.CreateNode();
Clicked(nodeModel, Position);
}
catch (Exception)
{
searchViewModel.dynamoViewModel.Model.Logger.Log("Failed to create node from search element: " + Model.Name);
searchViewModel.dynamoViewModel.MainGuideManager.CreateRealTimeInfoWindow(Wpf.Properties.Resources.NodeInCanvasSearchCreationError + Model.Name, true);
}
}
}

Expand Down