diff --git a/Terminal.Gui/Core/View.cs b/Terminal.Gui/Core/View.cs
index e94b1fa81..642a92729 100644
--- a/Terminal.Gui/Core/View.cs
+++ b/Terminal.Gui/Core/View.cs
@@ -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;
}
///
diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs
index 3eea30eb9..edda3950b 100644
--- a/Terminal.Gui/Views/ComboBox.cs
+++ b/Terminal.Gui/Views/ComboBox.cs
@@ -64,7 +64,7 @@ namespace Terminal.Gui {
///
public event Action OpenSelectedItem;
- IList searchset;
+ readonly IList searchset = new List