diff --git a/src/Xamarin.Android.Tools.JavadocImporter/DocumentSection.cs b/src/Xamarin.Android.Tools.JavadocImporter/DocumentSection.cs index 6aee6bc1e13..3030f73bfa0 100644 --- a/src/Xamarin.Android.Tools.JavadocImporter/DocumentSection.cs +++ b/src/Xamarin.Android.Tools.JavadocImporter/DocumentSection.cs @@ -317,6 +317,9 @@ abstract class JavaDocDocumentSection : DocumentSection public JavaDocDocumentSection (XElement sectionNode) { + if (sectionNode == null) + return; // Any derived classes might pass null element here. Since we cannot reject it here, we ignore the entire section. + section_node = sectionNode; foreach (XElement pp in section_node.XPathSelectElements (".//dl/dt")) { var b = pp.XPathSelectElement (SectionNameWrapperTag); @@ -428,6 +431,8 @@ public override string SectionNameWrapperTag { public override IEnumerable GetSummaryNodes () { + if (section_node == null) + return Enumerable.Empty (); var sumDL = section_node.Elements (XName.Get ("dd")).FirstOrDefault (); return sumDL == null ? Enumerable.Empty () : sumDL.Nodes ().TakeWhile (n => !(n is XElement && ((XElement)n).Name.LocalName != "dl"))