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:
authorJonathan Pryor <jonpryor@vt.edu>2014-05-15 00:04:05 +0400
committerDuncan Mak <duncanm@microsoft.com>2016-10-08 03:30:34 +0300
commit712445f69ea8af8d07a58e05608e0ef1d4d53251 (patch)
tree020a9e6d5e6aaa731ec4fb04b1d84a1d3f10bd8c /mdoc/Test/html.expected
parent0743f32d4b9cd7010eec3a1234fcd13cab6185a3 (diff)
[mdoc] Fix NullReferenceException when importing @name attribute.
(Reported by directhex on #mono 2014-05-14 at 14:28 EDT.) When importing Microsoft XML Documentation, if a //altmember/@name, //exception/@name, or //permission/@name attribute is encountered then mdoc will die with a NullReferenceException: mdoc: System.NullReferenceException: Object reference not set to an instance of an object at Mono.Documentation.MsxdocDocumentationImporter.ImportDocumentation (Mono.Documentation.DocsNodeInfo info) at Mono.Documentation.MDocUpdater.MakeDocNode (Mono.Documentation.DocsNodeInfo info) at Mono.Documentation.MDocUpdater.UpdateMember (Mono.Documentation.DocsNodeInfo info) at Mono.Documentation.MDocUpdater.MakeMember (System.Xml.XmlDocument doc, Mono.Documentation.DocsNodeInfo info) at Mono.Documentation.MDocUpdater.DoUpdateType2 (System.String message, System.Xml.XmlDocument basefile, Mono.Cecil.TypeDefinition type, System.String output, Boolean insertSince) at Mono.Documentation.MDocUpdater.StubType (Mono.Cecil.TypeDefinition type, System.String output) at Mono.Documentation.MDocUpdater.DoUpdateType (Mono.Cecil.TypeDefinition type, System.String basepath, System.String dest) at Mono.Documentation.MDocUpdater.DoUpdateAssembly (Mono.Cecil.AssemblyDefinition assembly, System.Xml.XmlElement index_types, System.String source, System.String dest, System.Collections.Generic.HashSet`1 goodfiles) at Mono.Documentation.MDocUpdater.DoUpdateAssemblies (System.String source, System.String dest) at Mono.Documentation.MDocUpdater.Run (IEnumerable`1 args) at Mono.Documentation.MDoc.Run (System.String[] args) at Mono.Documentation.MDoc.Main (System.String[] args) The cause of the NullReferenceException is due to inconsistent checking: we check that _either_ `child.Attributes["cref"]` OR `child.Attributes["name"]` is not null, and if one of them IS non-null then we just grab `child.Attributes["cref"].Value`, which will throw a NullReferenceException if the @name attribute was present but not the @cref attribute. The fix is to be consistent: once we grab an XmlAttribute, use the already looked up XmlAttribute, don't re-look it up.
Diffstat (limited to 'mdoc/Test/html.expected')
-rw-r--r--mdoc/Test/html.expected/Mono.DocTest/UseLists.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/mdoc/Test/html.expected/Mono.DocTest/UseLists.html b/mdoc/Test/html.expected/Mono.DocTest/UseLists.html
index eac70b5d..0f12f07e 100644
--- a/mdoc/Test/html.expected/Mono.DocTest/UseLists.html
+++ b/mdoc/Test/html.expected/Mono.DocTest/UseLists.html
@@ -442,6 +442,12 @@
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
</td>
</tr>
+ <tr valign="top">
+ <td>
+ <a href="javascript:alert(&quot;Documentation not found.&quot;)">Whatever</a>
+ </td>
+ <td>text!</td>
+ </tr>
</table>
</blockquote>
<h2 class="Section">Remarks</h2>