check for file existence before asking libxml to load a file
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <glibmm/fileutils.h>
|
||||
|
||||
#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;
|
||||
|
||||
Reference in New Issue
Block a user