when model is not yet loaded, but the element editor should be opened, a segmentation fault occurs. Do not set current index when m_model is not yet loaded

This commit is contained in:
Martin Marmsoler
2020-06-08 21:33:38 +02:00
committed by Laurent Trinques
parent 4a3b7e708a
commit d1742d5685

View File

@@ -123,7 +123,8 @@ void ElementsCollectionWidget::setCurrentLocation(const ElementsLocation &locati
if (!location.exist())
return;
m_tree_view->setCurrentIndex(m_model->indexFromLocation(location));
if (m_model)
m_tree_view->setCurrentIndex(m_model->indexFromLocation(location));
}
void ElementsCollectionWidget::leaveEvent(QEvent *event)