<p>The following will cause infinite recursion on the == operator overload method</p>

<pre><code>    Foo foo1 = null;
    Foo foo2 = new Foo();
    Assert.IsFalse(foo1 == foo2);

    public static bool operator ==(Foo foo1, Foo foo2) {
        if (foo1 == null) return foo2 == null;
        return foo1.Equals(foo2);
    }
</code></pre>

<p>How do I check for nulls?</p>

Cast to object in the overload method:
```
```
public static bool operator ==(Foo foo1, Foo foo2) {
    if ((object) foo1 == null) return (object) foo2 == null;
    return foo1.Equals(foo2);
}
```
```