Don't try to connect to nonexistent controllers (#4939)
Fixes crash on loading presets with controllers.
This commit is contained in:
committed by
Hyunjin Song
parent
82e3ba75c6
commit
91f9f1a890
@@ -205,7 +205,7 @@ void ControllerConnection::loadSettings( const QDomElement & _this )
|
||||
else
|
||||
{
|
||||
m_controllerId = _this.attribute( "id", "-1" ).toInt();
|
||||
if( m_controllerId < 0 )
|
||||
if( m_controllerId < 0 || m_controllerId >= Engine::getSong()->controllers().size() )
|
||||
{
|
||||
qWarning( "controller index invalid\n" );
|
||||
m_controllerId = -1;
|
||||
|
||||
Reference in New Issue
Block a user