microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 302 forks source link

NullReferenceException in >GraphViewer.CreateRectToFillCanvas() when re-assigning the graph #310

Open AdmiralSnyder opened 2 years ago

AdmiralSnyder commented 2 years ago

hi, when using the AutomaticGraphLayoutControl, assigning a graph, then assigning null and then assigning the same graph (I didn't test with a different graph...), a NRE is thrown because the Parent of the GraphCanvas was null.

this is fixed by changing the way AutomaticGraphLayoutControl.SetGraph() handles the re-assignment case... just some if statements need to be changed. i have a fix in my fork. should i PR it?

levnach commented 2 years ago

Sure, thanks!