Better error when no mail server has been configured before sending KDM emails.
authorCarl Hetherington <cth@carlh.net>
Sun, 10 Jan 2016 01:43:07 +0000 (01:43 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 10 Jan 2016 01:43:07 +0000 (01:43 +0000)
src/lib/cinema_kdms.cc

index 2b1d457aa1ad04614fa7d378207b1fde1584c38f..9b106a0111285b87ceee289ffba88f4344049c15 100644 (file)
@@ -124,6 +124,10 @@ CinemaKDMs::email (
 {
        Config* config = Config::instance ();
 
+       if (config->mail_server().empty()) {
+               throw NetworkError (_("No mail server configured in preferences"));
+       }
+
        BOOST_FOREACH (CinemaKDMs const & i, cinema_kdms) {
 
                boost::filesystem::path zip_file = boost::filesystem::temp_directory_path ();