Ensure that we don't attempt to sanitize nil

MSP-11595