Fix a null pointer error.