QmlDesigner: fixes crash

If there was no form editor item for the root we crashed in
the drop code

Reviewed-by: Kai Koehne
This commit is contained in:
Thomas Hartmann
2010-04-14 14:15:33 +02:00
parent b1577b0e20
commit 02250e1313

View File

@@ -182,7 +182,7 @@ FormEditorItem* DragTool::calculateContainer(const QPointF &point, FormEditorIte
return formEditorItem;
}
if (scene()->rootFormEditorItem()->boundingRect().adjusted(-100, -100, 100, 100).contains(point))
if (scene()->rootFormEditorItem() && scene()->rootFormEditorItem()->boundingRect().adjusted(-100, -100, 100, 100).contains(point))
return scene()->rootFormEditorItem();
return 0;
}