add some assert for reloading saved plugin pin connections
[ardour.git] / libs / ardour / io_processor.cc
index d23afce6120a6d32fbb63e341a6ce4132fd74c85..6a6f09bbe21b5787f11d9a3ef215d0b0d394a330 100644 (file)
@@ -167,8 +167,8 @@ IOProcessor::set_state (const XMLNode& node, int version)
        XMLNodeIterator niter;
        const string instr = enum_2_string (IO::Input);
        const string outstr = enum_2_string (IO::Output);
-       
-       if (_own_input) {
+
+       if (_own_input && _input) {
                for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
                        const XMLProperty* prop;
                        if ((prop = (*niter)->property ("name")) != 0) {
@@ -182,22 +182,22 @@ IOProcessor::set_state (const XMLNode& node, int version)
                                }
                        }
                }
-               
+
                if (io_node) {
                        _input->set_state(*io_node, version);
-                       
+
                        // legacy sessions: use IO name
                        if ((prop = node.property ("name")) == 0) {
                                set_name (_input->name());
                        }
-                       
+
                } else {
                        /* no input, which is OK */
                }
-               
+
        }
-       
-       if (_own_output) {
+
+       if (_own_output && _output) {
                for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
                        if ((*niter)->name() == "IO") {
                                const XMLProperty* prop;
@@ -213,10 +213,10 @@ IOProcessor::set_state (const XMLNode& node, int version)
                                }
                        }
                }
-               
+
                if (io_node) {
                        _output->set_state(*io_node, version);
-                       
+
                        // legacy sessions: use IO name
                        if ((prop = node.property ("name")) == 0) {
                                set_name (_output->name());