forked from qt-creator/qt-creator
QmlJS::Delta: fix crash if a document does not have a qmlProgram
This commit is contained in:
@@ -246,8 +246,11 @@ static QString _methodName(UiSourceElement *source)
|
||||
|
||||
|
||||
|
||||
Delta::DebugIdMap Delta::operator()(Document::Ptr doc1, Document::Ptr doc2, const DebugIdMap &debugIds)
|
||||
Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::Ptr &doc2, const DebugIdMap &debugIds)
|
||||
{
|
||||
Q_ASSERT(doc1->qmlProgram());
|
||||
Q_ASSERT(doc2->qmlProgram());
|
||||
|
||||
QHash< UiObjectMember*, QList<QDeclarativeDebugObjectReference > > newDebuggIds;
|
||||
|
||||
Map M = Mapping(doc1, doc2);
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
public:
|
||||
typedef QHash< UiObjectMember*, QList<QDeclarativeDebugObjectReference > > DebugIdMap;
|
||||
DebugIdMap operator()(Document::Ptr doc1, Document::Ptr doc2, const DebugIdMap& debugIds);
|
||||
DebugIdMap operator()(const QmlJS::Document::Ptr &doc1, const QmlJS::Document::Ptr &doc2, const DebugIdMap &debugIds);
|
||||
|
||||
QList<Change> changes() const;
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ void QmlJSLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc)
|
||||
if (!core->hasContext(dbgcontext))
|
||||
return;
|
||||
|
||||
if (doc && m_previousDoc && doc->fileName() == m_previousDoc->fileName()) {
|
||||
if (doc && m_previousDoc && doc->fileName() == m_previousDoc->fileName() && doc->qmlProgram() && m_previousDoc->qmlProgram()) {
|
||||
if (m_debugIds.isEmpty())
|
||||
m_debugIds = m_initialTable.value(doc->fileName());
|
||||
Delta delta;
|
||||
|
||||
Reference in New Issue
Block a user