Fixed a nullptr issue.