OSDN Git Service

QmlDesigner.statesEditor: crash fix
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 12 May 2011 14:41:45 +0000 (16:41 +0200)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Fri, 13 May 2011 09:10:44 +0000 (11:10 +0200)
The node instance view might be detached.

src/plugins/qmldesigner/components/stateseditor/stateseditorimageprovider.cpp

index 515c2e0..7ac0162 100644 (file)
@@ -49,6 +49,9 @@ QImage StatesEditorImageProvider::requestImage(const QString &id, QSize *size, c
     if (m_nodeInstanceView.isNull())
         return QImage();
 
+    if (!m_nodeInstanceView->model())
+        return QImage(); //NodeInstanceView might be detached
+
     QSize newSize = requestedSize;
 
     if (newSize.isEmpty())