Fix a potential null dereference.