Fix possible null pointer