File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -782,14 +782,17 @@ QgsProcessingMeshDatasetGroupsParameterDefinitionWidget::QgsProcessingMeshDatase
782782
783783 const QgsProcessingParameterMeshDatasetGroups *datasetGroupDef =
784784 static_cast < const QgsProcessingParameterMeshDatasetGroups *>( definition );
785- int currentIndex = mParentLayerComboBox ->findData ( datasetGroupDef->meshLayerParameterName () );
786- if ( currentIndex != -1 )
787- mParentLayerComboBox ->setCurrentIndex ( currentIndex );
788- else if ( !datasetGroupDef->meshLayerParameterName ().isEmpty () )
789- {
790- // if no layer parameter candidates found, we just add the existing one as a placeholder
791- mParentLayerComboBox ->addItem ( datasetGroupDef->meshLayerParameterName (), datasetGroupDef->meshLayerParameterName () );
792- mParentLayerComboBox ->setCurrentIndex ( mParentLayerComboBox ->count () - 1 );
785+ if ( datasetGroupDef )
786+ {
787+ int currentIndex = mParentLayerComboBox ->findData ( datasetGroupDef->meshLayerParameterName () );
788+ if ( currentIndex != -1 )
789+ mParentLayerComboBox ->setCurrentIndex ( currentIndex );
790+ else if ( !datasetGroupDef->meshLayerParameterName ().isEmpty () )
791+ {
792+ // if no layer parameter candidates found, we just add the existing one as a placeholder
793+ mParentLayerComboBox ->addItem ( datasetGroupDef->meshLayerParameterName (), datasetGroupDef->meshLayerParameterName () );
794+ mParentLayerComboBox ->setCurrentIndex ( mParentLayerComboBox ->count () - 1 );
795+ }
793796 }
794797
795798 setLayout ( vlayout );
You can’t perform that action at this time.
0 commit comments