microsoft / automatic-graph-layout

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

Editing sample crashes when trying to insert a node #371

Open pvillads opened 1 month ago

pvillads commented 1 month 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 1 month 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.