Fix controller loading error on loading projects
Fixes a regression in 91f9f1a890,
which added the range check into the wrong if statement.
This commit is contained in:
@@ -205,13 +205,15 @@ void ControllerConnection::loadSettings( const QDomElement & _this )
|
||||
else
|
||||
{
|
||||
m_controllerId = _this.attribute( "id", "-1" ).toInt();
|
||||
if( m_controllerId < 0 || m_controllerId >= Engine::getSong()->controllers().size() )
|
||||
if( m_controllerId < 0 )
|
||||
{
|
||||
qWarning( "controller index invalid\n" );
|
||||
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 ) );
|
||||
|
||||
Reference in New Issue
Block a user