Fix crash when open project containing a mesh with a extras dataset groups with incompatible mesh

QGis application crash when opening a project contain a mesh layer with a dataset groups wich has a incompatible mesh. It can  happen when the dataset groups file change after first loading.
This commit is contained in:
vcloarec 2019-05-02 21:18:21 -04:00 committed by Peter Petrik
parent 9820bb4fa9
commit 244bb5543a

View File

@ -317,7 +317,7 @@ void QgsMeshDatasetGroupTreeModel::addTreeItem( const QString &groupName, bool i
QModelIndex QgsMeshDatasetGroupTreeModel::groupIndexToModelIndex( int groupIndex )
{
if ( groupIndex < 0 )
if ( groupIndex < 0 || !mDatasetGroupIndexToItem.contains( groupIndex ) )
return QModelIndex();
const auto item = mDatasetGroupIndexToItem[groupIndex];