Commit 27241430 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.dragAndDrop: crashfix

dragNode might be invalid!
parent 40f552c1
...@@ -225,9 +225,11 @@ void DragTool::dropEvent(QGraphicsSceneDragDropEvent * event) ...@@ -225,9 +225,11 @@ void DragTool::dropEvent(QGraphicsSceneDragDropEvent * event)
} catch (RewritingException &e) { } catch (RewritingException &e) {
QMessageBox::warning(0, "Error", e.description()); QMessageBox::warning(0, "Error", e.description());
} }
if (m_dragNode.isValid()) {
QList<QmlItemNode> nodeList; QList<QmlItemNode> nodeList;
nodeList.append(m_dragNode); nodeList.append(m_dragNode);
view()->setSelectedQmlItemNodes(nodeList); view()->setSelectedQmlItemNodes(nodeList);
}
m_dragNode = ModelNode(); m_dragNode = ModelNode();
view()->changeToSelectionTool(); view()->changeToSelectionTool();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment