forked from qt-creator/qt-creator
QmlDesigner: Fix potential crash
Ensure the navigator is not crashing if no model is attached. Task-number: QTCREATORBUG-18420 Change-Id: I2748e61d34621167ff5908409046f8171ff76c85 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
1724ad7572
commit
7155a10bb7
@@ -331,6 +331,9 @@ ModelNode NavigatorTreeModel::modelNodeForIndex(const QModelIndex &index) const
|
||||
if (!index.isValid())
|
||||
return ModelNode();
|
||||
|
||||
if (!m_view->model())
|
||||
return ModelNode();
|
||||
|
||||
return m_view->modelNodeForInternalId(index.internalId());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user