diff options
author | Joni Poikelin <joni.poikelin@qt.io> | 2020-07-23 16:03:12 +0300 |
---|---|---|
committer | Joni Poikelin <joni.poikelin@qt.io> | 2020-08-21 11:55:52 +0300 |
commit | 0299c25208c130d148d75d071168fc5c2ffc4bbc (patch) | |
tree | ce566245194e07f058387a5ea872300296fb23f6 /src | |
parent | eed5683f89da937758dcea0d8a24c496b5216114 (diff) |
Fix error checking when attempting to connect nonexistent states
Pick-to: 5.15
Fixes: QTBUG-85710
Change-Id: If2e47df053d7c86654b57a9995b9ea4739475c81
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/scxml/qscxmlstatemachine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scxml/qscxmlstatemachine.cpp b/src/scxml/qscxmlstatemachine.cpp index 8a0afd7..e5967f8 100644 --- a/src/scxml/qscxmlstatemachine.cpp +++ b/src/scxml/qscxmlstatemachine.cpp @@ -1914,7 +1914,7 @@ QMetaObject::Connection QScxmlStateMachine::connectToStateImpl(const QString &sc types = QtPrivate::ConnectionTypes<QtPrivate::List<bool> >::types(); Q_D(QScxmlStateMachine); - const int signalIndex = d->m_stateNameToSignalIndex.value(scxmlStateName); + const int signalIndex = d->m_stateNameToSignalIndex.value(scxmlStateName, -1); return signalIndex < 0 ? QMetaObject::Connection() : QObjectPrivate::connectImpl(this, signalIndex, receiver, slot, slotObj, type, types, d->m_metaObject); |