From 0531e8007a549c11acf5cc3ff4c1d5ed66b10e98 Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Tue, 6 Apr 2010 15:08:46 +0200
Subject: [PATCH] QmlDesigner.visualEditor: avoid crash

---
 src/plugins/qmldesigner/components/formeditor/dragtool.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
index 132bd55f414..1257e1ffea2 100644
--- a/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/dragtool.cpp
@@ -155,6 +155,9 @@ void DragTool::createQmlItemNode(const ItemLibraryInfo &itemLibraryRepresentatio
 
 void DragTool::createQmlItemNodeFromImage(const QString &imageName, QmlItemNode parentNode, QPointF scenePos)
 {
+    if (!parentNode.isValid())
+        return;
+
     QmlDesignerItemLibraryDragAndDrop::CustomDragAndDrop::hide();
 
     MetaInfo metaInfo = MetaInfo::global();
-- 
GitLab