possible fix for error during export format load-from-disk
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 14 Feb 2014 21:33:44 +0000 (16:33 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 14 Feb 2014 21:33:44 +0000 (16:33 -0500)
libs/ardour/export_profile_manager.cc

index 7ff4282c74bcdea5ee64ff28ce57313689cda6bc..08fdb96e0d7a6c24c0ff70a547f8ae87d18c590c 100644 (file)
@@ -724,8 +724,20 @@ ExportProfileManager::load_formats ()
 void
 ExportProfileManager::load_format_from_disk (std::string const & path)
 {
-       XMLTree const tree (path);
-       ExportFormatSpecPtr format = handler->add_format (*tree.root());
+       XMLTree tree;
+
+       if (!tree.read (path)) {
+               error << string_compose (_("Cannot load export format from %1"), path) << endmsg;
+               return;
+       }
+
+       XMLNode* root = tree.root();
+       if (!root) {
+               error << string_compose (_("Cannot export format read from %1"), path) << endmsg;
+               return;
+       }
+
+       ExportFormatSpecPtr format = handler->add_format (*root);
 
        /* Handle id to filename mapping and don't add duplicates to list */