-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
The == overload in the Oid class is incorrect. In the case that one of the Oids in a comparison is null, an exception is thrown. The overload does not take into account the possibility that either reference is null.
This is what the overload should look like:
public static bool operator ==(Oid a, Oid b){
// Return true if both are same instance or both are null
if (System.Object.ReferenceEquals(a, b))
// Return false if only one instance is null
if (((object)a == null) || ((object)b == null))
return a.Equals(b);
}
This is taken from the following MS site:
http://msdn.microsoft.com/en-us/library/ms173147%28VS.80%29.aspx