Skip to content

Commit

Permalink
Fix Coverity null pointer dereference warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 3, 2018
1 parent cd39885 commit b22b62f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/gui/attributetable/qgsattributetableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void QgsAttributeTableView::setAttributeTableConfig( const QgsAttributeTableConf
void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel *filterModel )
{
mFilterModel = filterModel;
QTableView::setModel( filterModel );
QTableView::setModel( mFilterModel );

if ( mFilterModel )
{
Expand All @@ -120,7 +120,7 @@ void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel *filterModel
delete mFeatureSelectionModel;
mFeatureSelectionModel = nullptr;

if ( filterModel )
if ( mFilterModel )
{
if ( !mFeatureSelectionManager )
{
Expand All @@ -134,11 +134,11 @@ void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel *filterModel
this, static_cast<void ( QgsAttributeTableView::* )( const QModelIndexList &indexes )>( &QgsAttributeTableView::repaintRequested ) );
connect( mFeatureSelectionModel, static_cast<void ( QgsFeatureSelectionModel::* )()>( &QgsFeatureSelectionModel::requestRepaint ),
this, static_cast<void ( QgsAttributeTableView::* )()>( &QgsAttributeTableView::repaintRequested ) );
}

connect( mFilterModel->layer(), &QgsVectorLayer::editingStarted, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::editingStopped, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::readOnlyChanged, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::editingStarted, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::editingStopped, this, &QgsAttributeTableView::recreateActionWidgets );
connect( mFilterModel->layer(), &QgsVectorLayer::readOnlyChanged, this, &QgsAttributeTableView::recreateActionWidgets );
}
}

void QgsAttributeTableView::setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager )
Expand Down

0 comments on commit b22b62f

Please sign in to comment.