From 5e12abc10ced54cf169773be78d19fc767b2439f Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 12 May 2009 12:19:53 +0200 Subject: Fixes crash when calling QState::setErrorState() with null pointer When the state is null, it isn't the root state. --- src/corelib/statemachine/qstate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v0.12