Skip to content
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-6967 Crash when placing List selector archi-lab Dynamo nodes in canvas #15224

Merged
merged 5 commits into from
May 17, 2024
Merged
Changes from 1 commit
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
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 (in-Canvas search or library)
// 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);
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
searchViewModel.dynamoViewModel.MainGuideManager.CreateRealTimeInfoWindow("Failed to create node: " + Model.Name, true);
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

Expand Down
Loading