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

Conversation

mjkkirschner
Copy link
Member

@mjkkirschner mjkkirschner commented Sep 22, 2021

Purpose

I was not able to reproduce this crash, but my guess is that somehow engineController has been disposed/set to null temporarily, which does happen from time to time when reseting the vm, opening a new graph, or at shutdown.

Check for nulls, and bail.

System.NullReferenceException in
 Dynamo.Graph.Nodes.NodeModelExtensions.GeneratedGraphicItems(NodeModel node,
EngineController engineController) in System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext() in
Dynamo.Applications.ViewModel.RevitWatch3DViewModel.Draw(NodeModel node) in
System.EventHandler`1.Invoke(Object sender, TEventArgs e) in
Dynamo.Models.DynamoModel.OnEvaluationCompleted(Object sender, EvaluationCompletedEventArgs e) in
System.EventHandler`1.Invoke(Object sender, TEventArgs e) in
Dynamo.Graph.Workspaces.HomeWorkspaceModel.OnEvaluationCompleted(EvaluationCompletedEventArgs e) in 

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Copy link
Contributor

@sm6srw sm6srw left a comment

Choose a reason for hiding this comment

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

LGTM!

{
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 ?...)

@mjkkirschner mjkkirschner merged commit 2d70d5b into DynamoDS:master Sep 23, 2021
@mjkkirschner mjkkirschner deleted the dyn3859 branch September 23, 2021 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants