happens in numerous places. Instead, take a page out of the "I
never should have invented `null'" book, and ensure that Tree.Nodes
can never be null. This fixes the "HelpSource has 0 items" issue
and several other related ones.
svn path=/trunk/mcs/; revision=128134
+2009-02-26 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Monodoc/provider.cs: Revert; Don't check for Tree.Nodes == null, as it
+ happens in numerous places. Instead, take a page out of the "I
+ never should have invented `null'" book, and ensure that Tree.Nodes
+ can never be null. This fixes the "HelpSource has 0 items" issue
+ and several other related ones.
+
2009-02-26 Jonathan Pryor <jonpryor@vt.edu>
* Monodoc/provider.cs: It's possible for a HelpSource to have 0
protected ArrayList nodes;
protected internal int position;
+ static ArrayList empty = ArrayList.ReadOnly(new ArrayList(0));
+
/// <summary>
/// Creates a node, called by the Tree.
/// </summary>
get {
if (position < 0)
LoadNode ();
- return nodes;
+ return nodes != null ? nodes : empty;
}
}
parent = third_party;
}
- if (hs.Tree.Nodes == null)
- continue;
-
foreach (Node n in hs.Tree.Nodes){
parent.AddNode (n);
}