Fix crash when closing QML files

Reviewed-by: Thomas Hartmann
Task-number: QTCREATORBUG-4459
This commit is contained in:
Robert Loehning
2011-04-11 17:10:13 +02:00
parent 63870572fe
commit a0d1d7af4a

View File

@@ -201,7 +201,7 @@ void DesignDocumentController::blockModelSync(bool block)
attachNodeInstanceView();
QmlModelState state;
//We go back to base state (and back again) to avoid side effects from text editing.
if (m_d->statesEditorView) {
if (m_d->statesEditorView && m_d->statesEditorView->model()) {
state = m_d->statesEditorView->currentState();
m_d->statesEditorView->setCurrentState(m_d->statesEditorView->baseState());