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:
Thomas Hartmann
2017-07-03 12:37:16 +02:00
committed by Tim Jenssen
parent 1724ad7572
commit 7155a10bb7

View File

@@ -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());
}