diff options
Diffstat (limited to 'nejdb/Ejdb.SON/BSONOid.cs')
-rw-r--r-- | nejdb/Ejdb.SON/BSONOid.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nejdb/Ejdb.SON/BSONOid.cs b/nejdb/Ejdb.SON/BSONOid.cs index 192d3da..9059792 100644 --- a/nejdb/Ejdb.SON/BSONOid.cs +++ b/nejdb/Ejdb.SON/BSONOid.cs @@ -91,6 +91,12 @@ namespace Ejdb.SON { } public override bool Equals(object obj) { + if (obj == null) { + return false; + } + if (ReferenceEquals(this, obj)) { + return true; + } if (obj is BSONOid) { return (CompareTo((BSONOid) obj) == 0); } @@ -102,10 +108,9 @@ namespace Ejdb.SON { } public static bool operator ==(BSONOid a, BSONOid b) { - if (ReferenceEquals(a, b)) { + if (ReferenceEquals(a, b)) return true; - } - if (a == null || b == null) { + if ((object) a == null || (object) b == null) { return false; } return a.Equals(b); |