Try ReferenceEquals: public static bool operator ==(Foo foo1, Foo foo2) { if (object.ReferenceEquals(null, foo1)) { if(object.ReferenceEquals(null, foo2)) return true; return false; } if(object.ReferenceEquals(null, foo2)) return false; ...