Fixed possible Null pointer error. Found with FindBugs.