From a1fdac58e690356a1171632d1ef87b00a08d4bb1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 1 Aug 2025 18:35:08 -0600 Subject: [PATCH] check for file existence before asking libxml to load a file --- gtk2_ardour/region_ui_settings.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gtk2_ardour/region_ui_settings.cc b/gtk2_ardour/region_ui_settings.cc index 6d3868c832..c4f4efe523 100644 --- a/gtk2_ardour/region_ui_settings.cc +++ b/gtk2_ardour/region_ui_settings.cc @@ -16,6 +16,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include + #include "pbd/types_convert.h" #include "pbd/error.h" #include "pbd/xml++.h" @@ -151,6 +153,10 @@ RegionUISettingsManager::load (std::string const & xmlpath) clear (); + if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) { + return -1; + } + if (!state_tree.read (xmlpath)) { std::cerr << "bad xmlpath " << xmlpath << std::endl; return -1;