Improve help text and error-reporting for ardour-export
[ardour.git] / session_utils / common.cc
index 99ed10d32d35d0dd9f04585e394bb863d15f15e1..eb17cfdbeb21e0b4a76d04d1006a201945b04f29 100644 (file)
@@ -123,6 +123,12 @@ static Session * _load_session (string dir, string state)
        std::string v;
 
        std::string s = Glib::build_filename (dir, state + statefile_suffix);
+
+       if (!Glib::file_test (s, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) {
+               std::cerr << "Cannot read session '"<< s << "'\n";
+               return 0;
+       }
+
        if (Session::get_info_from_path (s, sr, sf, v) == 0) {
                if (engine->set_sample_rate (sr)) {
                        std::cerr << "Cannot set session's samplerate.\n";