Skip to content

Commit

Permalink
Safety guard to prevent crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 17, 2018
1 parent c7cb5a8 commit 6f63957
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2700,7 +2700,9 @@ bool QgsPostgresProvider::changeAttributeValues( const QgsChangedAttributesMap &
{
QVariantList k = mShared->removeFid( fid );

for ( int i = 0; i < mPrimaryKeyAttrs.size(); i++ )
int keyCount = std::min( mPrimaryKeyAttrs.size(), k.size() );

for ( int i = 0; i < keyCount; i++ )
{
int idx = mPrimaryKeyAttrs.at( i );
if ( !attrs.contains( idx ) )
Expand Down

0 comments on commit 6f63957

Please sign in to comment.