diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-05-08 07:55:28 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-05-08 07:55:28 (GMT) |
commit | 58bf96d7252df3346d0f325af265873897e56172 (patch) | |
tree | 5709dcd3700974015eb06d190907f30c5cc25c22 /src | |
parent | 00f04527d3d28ab1aa5b90b9a05366012ff5d1e5 (diff) | |
download | Qt-58bf96d7252df3346d0f325af265873897e56172.zip Qt-58bf96d7252df3346d0f325af265873897e56172.tar.gz Qt-58bf96d7252df3346d0f325af265873897e56172.tar.bz2 |
don't create transition to null state
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/statemachine/qstate.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index 4d12219..63a0a69 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -381,9 +381,12 @@ protected: */ QAbstractTransition *QState::addTransition(QAbstractState *target) { + if (!target) { + qWarning("QState::addTransition: cannot add transition to null state"); + return 0; + } UnconditionalTransition *trans = new UnconditionalTransition(target); - addTransition(trans); - return trans; + return addTransition(trans); } /*! |