2007-05-11 Jonathan Chambers <joncham@gmail.com>
[mono.git] / mcs / class / corlib / System.Reflection / Module.cs
index ff3c94f9765c84cdd17acc6bb469ba6756e615b3..6c136534127aeb479c74f57eea919b285d050a2e 100644 (file)
@@ -162,7 +162,12 @@ namespace System.Reflection {
        
                public MethodInfo GetMethod (string name) 
                {
-                       return GetMethodImpl (name, defaultBindingFlags, null, CallingConventions.Any, Type.EmptyTypes, null);
+                       // Can't call the other overloads since they call Type.GetMethod () which does a null check on the 'types' array
+                       if (IsResource ())
+                               return null;
+
+                       Type globalType = GetGlobalType ();
+                       return (globalType != null) ? globalType.GetMethod (name) : null;
                }
        
                public MethodInfo GetMethod (string name, Type[] types)