Fix for crash involving not checking for a null return