Skip to content

Commit

Permalink
Don't crash the projection selection widget when world_map.shp fails …
Browse files Browse the repository at this point in the history
…to load (#5977)

* initiate mExpressionFieldBuffer in the constructor
  • Loading branch information
nirvn authored Jan 3, 2018
1 parent 6ed078c commit df547e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ QgsVectorLayer::QgsVectorLayer( const QString &vectorLayerPath,
mJoinBuffer = new QgsVectorLayerJoinBuffer( this );
connect( mJoinBuffer, &QgsVectorLayerJoinBuffer::joinedFieldsChanged, this, &QgsVectorLayer::onJoinedFieldsChanged );

mExpressionFieldBuffer = new QgsExpressionFieldBuffer();
// if we're given a provider type, try to create and bind one to this layer
if ( !vectorLayerPath.isEmpty() && !mProviderKey.isEmpty() )
{
Expand Down Expand Up @@ -1555,7 +1556,6 @@ bool QgsVectorLayer::setDataProvider( QString const &provider )
// get and store the feature type
mWkbType = mDataProvider->wkbType();

mExpressionFieldBuffer = new QgsExpressionFieldBuffer();
updateFields();

if ( mProviderKey == QLatin1String( "postgres" ) )
Expand Down

2 comments on commit df547e1

@elpaso
Copy link
Contributor

@elpaso elpaso commented on df547e1 Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would you also please check if all the related bugs in the hub are closed/updated ?

@nirvn
Copy link
Contributor Author

@nirvn nirvn commented on df547e1 Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elpaso , yeah, I want to give it 24 hours so folks can test a nightly and confirm that it did fix their respective crash. Hopefully this was a catch-all fix ;)

Please sign in to comment.