Fixed possible null pointer.