microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.36k stars 307 forks source link

Editing sample crashes when trying to insert a node #371

Closed pvillads closed 2 weeks ago

pvillads commented 4 months ago

Run the Editing sample. it will start running, showing a sample graph. To repro the problem, go to the right bottom corner and right-click to produce the context menu. That context menu contains an option called "Insert Ellipse". Select this option (or any of the other node type options) and the app will crash with:

System.Collections.Generic.KeyNotFoundException: 'The given key was not present in the dictionary.'

in FindNode in Graph.cs.

levnach commented 4 months ago

Fixed by https://github.com/microsoft/automatic-graph-layout/commit/e1ec242ff0299c358fddad1c19c69add318ee874 checking that the key is present in a SortedDictionary. I expect more crashes here since it seems the behavior of the operator [] has changed.