Author: spouliot
Date: 2008-02-16 20:50:27 -0500 (Sat, 16 Feb 2008)
New Revision: 95953
Modified:
trunk/mono-tools/gendarme/framework/Gendarme.Framework/AssemblyResolver.cs
trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
Log:
2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
* AssemblyResolver.cs: Fix NRE when resolving some methods
Modified:
trunk/mono-tools/gendarme/framework/Gendarme.Framework/AssemblyResolver.cs
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/AssemblyResolver.cs
2008-02-17 01:40:11 UTC (rev 95952)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/AssemblyResolver.cs
2008-02-17 01:50:27 UTC (rev 95953)
@@ -125,10 +125,16 @@
{
while (type != null) {
MethodDefinition method = GetMethod
(type.Methods, reference);
- if (method == null)
+ if (method == null) {
+ // spouliot
+ // things like: System.Byte
System.Byte[,]::Get(System.Int32,System.Int32)
+ // would cause a NRE here
+ if (type.BaseType == null)
+ return null;
type = Resolve (type.BaseType);
- else
+ } else {
return method;
+ }
}
return null;
Modified: trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
===================================================================
--- trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
2008-02-17 01:40:11 UTC (rev 95952)
+++ trunk/mono-tools/gendarme/framework/Gendarme.Framework/ChangeLog
2008-02-17 01:50:27 UTC (rev 95953)
@@ -1,5 +1,6 @@
-2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
+2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
+ * AssemblyResolver.cs: Fix NRE when resolving some methods
* Defect.cs: Make ExtractFirst methods static. Rename
Get[Type|Method]FromLocation to Find*
* Runner.cs: Handle case where MDB is unavailable.
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches