summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/statemachine')
-rw-r--r--src/corelib/statemachine/qstate.cpp7
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);
}
/*!