[Mono-dev] Patch for AssemblyNameReference Parse method

Eyal Alaluf eyala at mainsoft.com
Wed Oct 4 12:15:10 EDT 2006


Hi, JB.

This is a small fix to the Parse static method of AssemblyNameReference
where the value of PublicToken in the string is allowe to be "null".
Let me know if you have any comments before I commit this patch.

Eyal.
-------------- next part --------------
Index: Mono.Cecil/AssemblyNameReference.cs

===================================================================

--- Mono.Cecil/AssemblyNameReference.cs	(revision 66216)

+++ Mono.Cecil/AssemblyNameReference.cs	(working copy)

@@ -159,6 +159,9 @@

 					break;
 				case "PublicKeyToken":
 					string pkToken = parts [1];
+					if (pkToken == "null")
+						break;
+
 					name.PublicKeyToken = new byte [pkToken.Length / 2];
 					for (int j = 0; j < name.PublicKeyToken.Length; j++) {
 						name.PublicKeyToken [j] = Byte.Parse (pkToken.Substring (j * 2, 2), NumberStyles.HexNumber);


More information about the Mono-devel-list mailing list