Add check for null email_settings object