Skip to content

Commit

Permalink
Merge pull request #8689 from m-kuhn/prevent_crash
Browse files Browse the repository at this point in the history
Safety guard to prevent crashes
  • Loading branch information
m-kuhn authored Dec 17, 2018
2 parents cbe7ac6 + 6f63957 commit bebc34b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
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 bebc34b

Please sign in to comment.