Fixed a potential null error.