summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-12 10:19:53 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-12 10:19:53 (GMT)
commit5e12abc10ced54cf169773be78d19fc767b2439f (patch)
treea852dbe48be83a1d3a91f69168d835944c257a70 /src/corelib/statemachine
parente51a4a22cdeb200d2851c96a82b4c282ec5dd2d3 (diff)
downloadQt-5e12abc10ced54cf169773be78d19fc767b2439f.zip
Qt-5e12abc10ced54cf169773be78d19fc767b2439f.tar.gz
Qt-5e12abc10ced54cf169773be78d19fc767b2439f.tar.bz2
Fixes crash when calling QState::setErrorState() with null pointer
When the state is null, it isn't the root state.
Diffstat (limited to 'src/corelib/statemachine')
-rw-r--r--src/corelib/statemachine/qstate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 5f61865..3a3bfc3 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -285,7 +285,7 @@ void QState::setErrorState(QAbstractState *state)
"to a different state machine");
return;
}
- if (state->machine() != 0 && state->machine()->rootState() == state) {
+ if (state != 0 && state->machine() != 0 && state->machine()->rootState() == state) {
qWarning("QStateMachine::setErrorState: root state cannot be error state");
return;
}