forked from qt-creator/qt-creator
QmlLivePreview: fix crash when inserting node with no parents
Change-Id: Ib781f64aed11aafc106dc15b40689181fefd5dd3 Reviewed-on: http://codereview.qt.nokia.com/3171 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -511,6 +511,7 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
|
|||||||
|
|
||||||
if (!M.way2.contains(y)) {
|
if (!M.way2.contains(y)) {
|
||||||
UiObjectMember* parent = parents2.parent.value(y);
|
UiObjectMember* parent = parents2.parent.value(y);
|
||||||
|
if (parent) {
|
||||||
if ( parent->kind == QmlJS::AST::Node::Kind_UiArrayBinding )
|
if ( parent->kind == QmlJS::AST::Node::Kind_UiArrayBinding )
|
||||||
parent = parents2.parent.value(parent);
|
parent = parents2.parent.value(parent);
|
||||||
|
|
||||||
@@ -519,6 +520,7 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
|
|||||||
qDebug () << "Delta::operator(): insert " << label(y, doc2) << " to " << label(parent, doc2);
|
qDebug () << "Delta::operator(): insert " << label(y, doc2) << " to " << label(parent, doc2);
|
||||||
insert(y, parent, newDebuggIds.value(parent), doc2);
|
insert(y, parent, newDebuggIds.value(parent), doc2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
UiObjectMember *x = M.way2[y];
|
UiObjectMember *x = M.way2[y];
|
||||||
|
Reference in New Issue
Block a user