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

harden GeneratedGraphicItems methods #12054

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Changes from all 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
7 changes: 5 additions & 2 deletions src/DynamoCore/Graph/Nodes/NodeModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ internal static bool IsUpstreamOf(this NodeModel node, NodeModel otherNode)

internal static List<IGraphicItem> GeneratedGraphicItems(this NodeModel node, EngineController engineController)
{
var ids = node.GetAllOutportAstIdentifiers();

var results = new List<IGraphicItem>();
if (node is null || engineController is null)
{
return results;
}
var ids = node.GetAllOutportAstIdentifiers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EngineController looks like the main suspect
https://git.autodesk.com/Dynamo/DynamoRevit/blob/14cf7520884a2e285c81241847097fccf1cd6999/src/DynamoRevit/ViewModel/RevitWatch3DViewModel.cs#L121-L133

And I do see a lot of code in Dynamo checks if the controller is null (maybe some graphics are generated while the DynamoModel is being disposed ?...)


foreach (var id in ids)
{
Expand Down