From 239f3e9c15408d8b7ca2226570584514e6f4b0f6 Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Tue, 28 Dec 2010 19:27:39 +0100 Subject: [PATCH] Fixed crash when expanding CD if no CD in drive; see issue #431 --- rtengine/safegtk.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtengine/safegtk.cc b/rtengine/safegtk.cc index 69305e8f3..686b1eaae 100644 --- a/rtengine/safegtk.cc +++ b/rtengine/safegtk.cc @@ -117,6 +117,9 @@ void safe_build_subdir_list (Glib::RefPtr &dir, std::vector dirList; if (dir) { + // CD-ROMs with no drive inserted are reported, but do not exist, causing RT to crash + if (!safe_file_test(dir->get_path(),Glib::FILE_TEST_EXISTS)) return; + SAFE_ENUMERATOR_CODE_START if (info->get_file_type() == Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || add_hidden)) subDirs.push_back (info->get_name());