Skip to content
Permalink
Browse files

add missing invalid layer check

  • Loading branch information
tomasMizera authored and nyalldawson committed Nov 12, 2020
1 parent 4d61102 commit 928c10a707c24159e3c6c5bc97ac4489db404250
@@ -316,6 +316,9 @@ void QgsQuickAttributeFormModelBase::flatten( QgsAttributeEditorContainer *conta

void QgsQuickAttributeFormModelBase::updateVisibility( int fieldIndex )
{
if ( !mLayer || !mLayer->isValid() )
return;

QgsFields fields = mAttributeModel->featureLayerPair().feature().fields();
mExpressionContext.setFields( fields );
mExpressionContext.setFeature( mAttributeModel->featureLayerPair().feature() );
@@ -207,7 +207,7 @@ QHash<int, QByteArray> QgsQuickFeaturesListModel::roleNames() const

int QgsQuickFeaturesListModel::featuresCount() const
{
if ( mCurrentLayer )
if ( mCurrentLayer && mCurrentLayer->isValid() )
return mCurrentLayer->featureCount();
return 0;
}

0 comments on commit 928c10a

Please sign in to comment.
You can’t perform that action at this time.