mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
ComboBox cursonDownKey nullref fix (#1472)
* added null guard to fix null ref when pressing keyDown inside combobox Improved an error message when view cannot be found * Added a unit test to ensure combobox can process all key events Found and fixed a new nullref * Found a new bug when source is already present and combobox is added to a top view * searchSet is auto initialized to new List() now to make the code a little bit safer
This commit is contained in:
@@ -1870,16 +1870,19 @@ namespace Terminal.Gui {
|
||||
}
|
||||
}
|
||||
|
||||
if (edges.Any () && edges.First ().From != Application.Top) {
|
||||
if (!ReferenceEquals (edges.First ().From, edges.First ().To)) {
|
||||
throw new InvalidOperationException ($"TopologicalSort (for Pos/Dim) cannot find {edges.First ().From}. Did you forget to add it to {this}?");
|
||||
} else {
|
||||
throw new InvalidOperationException ("TopologicalSort encountered a recursive cycle in the relative Pos/Dim in the views of " + this);
|
||||
}
|
||||
} else {
|
||||
// return L (a topologically sorted order)
|
||||
return result;
|
||||
}
|
||||
if (edges.Any ()) {
|
||||
var (from, to) = edges.First ();
|
||||
if (from != Application.Top) {
|
||||
if (!ReferenceEquals (from, to)) {
|
||||
throw new InvalidOperationException ($"TopologicalSort (for Pos/Dim) cannot find {from} linked with {to}. Did you forget to add it to {this}?");
|
||||
} else {
|
||||
throw new InvalidOperationException ("TopologicalSort encountered a recursive cycle in the relative Pos/Dim in the views of " + this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return L (a topologically sorted order)
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user