Removed unnecessary null pointer checks