Fix crash on relayering.
[ardour.git] / libs / ardour / user_bundle.cc
index 2dee0af01eeaa74836d7b1becaae1dc9d7cdb49b..1abb3fba877c48e77c59d336f287ae37d837d925 100644 (file)
@@ -1,7 +1,7 @@
 #include <cassert>
-#include <pbd/failed_constructor.h>
-#include <pbd/compose.h>
-#include <pbd/xml++.h>
+#include "pbd/failed_constructor.h"
+#include "pbd/compose.h"
+#include "pbd/xml++.h"
 #include "ardour/user_bundle.h"
 #include "ardour/port_set.h"
 #include "ardour/io.h"
@@ -45,7 +45,12 @@ ARDOUR::UserBundle::set_state (XMLNode const & node)
                        return -1;
                }
 
-               add_channel ("XXX");
+               if ((name = (*i)->property ("name")) == 0) {
+                       PBD::error << _("Node for Channel has no \"name\" property") << endmsg;
+                       return -1;
+               }
+               
+               add_channel (name->value ());
 
                XMLNodeList const ports = (*i)->children ();