Just a tip...
This is a fairly common bug, especially for people new to coding in Java or C++ (identical syntax). There are a couple of ways to catch it before it bites you.
1. Eclipse has an optional warning called "Possible accidental boolean assignment (e.g. if (a=b))". Turn this on! Other IDEs may have a similar feature -- if not, they should!
2. Swap the values so that the constant (in this case, "null") is on the left side. Since the constant cannot be assigned a value using "=", this will cause a compile error. This is a good practice to get used to.
Code:
if (null = o) {...} // compile error
if (null == o) {...} // no compile error