OSDN Git Service

Fix crash when closing QML files
authorRobert Loehning <robert.loehning@nokia.com>
Mon, 11 Apr 2011 15:10:13 +0000 (17:10 +0200)
committerRobert Loehning <robert.loehning@nokia.com>
Mon, 11 Apr 2011 15:10:33 +0000 (17:10 +0200)
Reviewed-by: Thomas Hartmann
Task-number: QTCREATORBUG-4459

src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp

index 1ce51b8..a8729ef 100644 (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());