Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/api-doc-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martinez <joelmartinez@gmail.com>2020-03-05 21:53:48 +0300
committerJoel Martinez <joelmartinez@gmail.com>2020-03-05 22:01:20 +0300
commit99195374d442faed8fc087cfbb25ba493442688c (patch)
tree02fe8d43cf6744539a50a036b96fef64f4ee9384 /mdoc/Mono.Documentation/Updater/DocUtils.cs
parentae44f5b3303d7f50437281e7b522a5d6a7945ca6 (diff)
Improves null handling in doc importer.
Resolves https://ceapex.visualstudio.com/Engineering/_workitems/edit/183262
Diffstat (limited to 'mdoc/Mono.Documentation/Updater/DocUtils.cs')
-rw-r--r--mdoc/Mono.Documentation/Updater/DocUtils.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/mdoc/Mono.Documentation/Updater/DocUtils.cs b/mdoc/Mono.Documentation/Updater/DocUtils.cs
index 4e47a3f4..8af7befd 100644
--- a/mdoc/Mono.Documentation/Updater/DocUtils.cs
+++ b/mdoc/Mono.Documentation/Updater/DocUtils.cs
@@ -270,12 +270,14 @@ namespace Mono.Documentation.Updater
bool removed = true;
foreach (var nchild in n.ChildNodes.Cast<XmlNode>().ToArray())
{
+ if (nchild == null) continue;
+
if (depth == 0)
{
// check the first level children to see if there's an incoming node that matches
- var avalues = nchild.Attributes.Cast<XmlAttribute>().Select(a => $"@{a.Name}='{a.Value}'").ToArray();
+ var avalues = nchild.Attributes?.Cast<XmlAttribute>().Select(a => $"@{a.Name}='{a.Value}'").ToArray();
var nodexpath = $"./{nchild.Name}";
- if (avalues.Length > 0)
+ if (avalues?.Length > 0)
nodexpath += $"[{ string.Join(" AND ", avalues) }]";
var incomingEquivalent = incoming.SelectSingleNode(nodexpath);
if (incomingEquivalent != null)