diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index d835c4a20f..4facf5db64 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -225,7 +225,7 @@ AudioDiskstream::get_input_sources () connections.clear (); - if (_io->nth (n)->get_connections (connections) == 0) { + if ((_io->nth (n).get()) && (_io->nth (n)->get_connections (connections) == 0)) { if (!(*chan)->source.name.empty()) { // _source->disable_metering (); } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 0d66da7795..5e9e5aa0c1 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1040,7 +1040,8 @@ IO::make_connections_2X (const XMLNode& node, int /*version*/, bool in) if (p != string::npos) { ports[x].replace (p, 4, "/audio_out"); } - nth(i)->connect (ports[x]); + if (NULL != nth(i).get()) + nth(i)->connect (ports[x]); } } @@ -1082,7 +1083,8 @@ IO::make_connections_2X (const XMLNode& node, int /*version*/, bool in) if (p != string::npos) { ports[x].replace (p, 3, "/audio_in"); } - nth(i)->connect (ports[x]); + if (NULL != nth(i).get()) + nth(i)->connect (ports[x]); } } @@ -1606,8 +1608,10 @@ IO::connected_to (boost::shared_ptr other) const for (i = 0; i < no; ++i) { for (j = 0; j < ni; ++j) { - if (nth(i)->connected_to (other->nth(j)->name())) { - return true; + if ((NULL != nth(i).get()) && (NULL != other->nth(j).get())) { + if (nth(i)->connected_to (other->nth(j)->name())) { + return true; + } } } }