From 679e3ac1fc9f11ca44c795fc77063488c3ea6686 Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Fri, 24 Sep 2010 09:29:32 +0200
Subject: [PATCH] QmlDesigner.Model: fix wrong assert

This assert is simply wrong. A component
might reparent the item inside an item,
that has no instance.
---
 src/plugins/qmldesigner/designercore/model/qmlanchors.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp b/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp
index 1df6106b95a..57f5368641c 100644
--- a/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp
+++ b/src/plugins/qmldesigner/designercore/model/qmlanchors.cpp
@@ -326,7 +326,9 @@ AnchorLine QmlAnchors::instanceAnchor(AnchorLine::Type sourceAnchorLine) const
     if (targetAnchorLine == AnchorLine::Invalid )
         return AnchorLine();
 
-    Q_ASSERT(targetAnchorLinePair.second.isValid());
+    if (!targetAnchorLinePair.second.isValid()) //there might be no node instance for the parent
+        return AnchorLine();
+
     return AnchorLine(QmlItemNode(qmlItemNode().nodeForInstance(targetAnchorLinePair.second)), targetAnchorLine);
 }
 
-- 
GitLab