Fixed a null pointer access.