Fixed possible null pointer dereference.

Thanks FindBugs!