Browse Source

2008-08-07 Jb Evain <[email protected]>

	* Expression.cs (GetAssociatedProperty): strengthen accessors
	comparisons.

svn path=/trunk/mcs/; revision=109858
Jb Evain 17 years ago
parent
commit
ddf0460e04

+ 5 - 0
mcs/class/System.Core/System.Linq.Expressions/ChangeLog

@@ -1,3 +1,8 @@
+2008-08-07  Jb Evain  <[email protected]>
+
+	* Expression.cs (GetAssociatedProperty): strengthen accessors
+	comparisons.
+
 2008-08-02  Zoltan Varga  <[email protected]>
 
 	* BinaryExpression.cs (EmitBinaryOperator): Mask out the upper bits of the 

+ 5 - 2
mcs/class/System.Core/System.Linq.Expressions/Expression.cs

@@ -2075,10 +2075,13 @@ namespace System.Linq.Expressions {
 
 		static PropertyInfo GetAssociatedProperty (MethodInfo method)
 		{
+			if (method == null)
+				return null;
+
 			foreach (var prop in method.DeclaringType.GetProperties (All)) {
-				if (prop.GetGetMethod (true) == method)
+				if (method.Equals (prop.GetGetMethod (true)))
 					return prop;
-				if (prop.GetSetMethod (true) ==  method)
+				if (method.Equals (prop.GetSetMethod (true)))
 					return prop;
 			}