diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index 45e36e12fc0..7847efda117 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -211,10 +211,12 @@ void ControllerConnection::loadSettings( const QDomElement & _this ) m_controllerId = -1; } - if (!Engine::getSong()->isLoadingProject() && m_controllerId != -1) + if (!Engine::getSong()->isLoadingProject() + && m_controllerId != -1 + && m_controllerId < Engine::getSong()->controllers().size()) { setController( Engine::getSong()-> - controllers().at( m_controllerId ) ); + controllers().at( m_controllerId ) ); } else { @@ -224,11 +226,9 @@ void ControllerConnection::loadSettings( const QDomElement & _this ) } + + void ControllerConnection::deleteConnection() { delete this; } - - - -