Skip to content

Commit 934ea6d

Browse files
committed
Fix controller loading error on loading projects
Fixes a regression in 91f9f1a, which added the range check into the wrong if statement.
1 parent 50796b2 commit 934ea6d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/core/ControllerConnection.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,15 @@ void ControllerConnection::loadSettings( const QDomElement & _this )
205205
else
206206
{
207207
m_controllerId = _this.attribute( "id", "-1" ).toInt();
208-
if( m_controllerId < 0 || m_controllerId >= Engine::getSong()->controllers().size() )
208+
if( m_controllerId < 0 )
209209
{
210210
qWarning( "controller index invalid\n" );
211211
m_controllerId = -1;
212212
}
213213

214-
if (!Engine::getSong()->isLoadingProject() && m_controllerId != -1)
214+
if (!Engine::getSong()->isLoadingProject()
215+
&& m_controllerId != -1
216+
&& m_controllerId < Engine::getSong()->controllers().size())
215217
{
216218
setController( Engine::getSong()->
217219
controllers().at( m_controllerId ) );

0 commit comments

Comments
 (0)