Navigation Menu

Skip to content

Commit

Permalink
[GRASS] fixed crash when adding table for existing features
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Oct 9, 2015
1 parent c64d5ff commit d26765f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/grass/qgsgrassvectormaplayer.cpp
Expand Up @@ -643,13 +643,13 @@ void QgsGrassVectorMapLayer::createTable( const QgsFields &fields, QString &erro
mTableFields.append( fields[i] );
mAttributeFields.append( fields[i] );
}
mHasTable = true;
mKeyColumn = 0;
insertCats( error );
if ( !error.isEmpty() )
{
QgsDebugMsg( error );
}
mHasTable = true;
mKeyColumn = 0;
}
QgsDebugMsg( "Table successfully created" );
}
Expand Down Expand Up @@ -792,8 +792,8 @@ void QgsGrassVectorMapLayer::insertCats( QString &error )
QgsDebugMsg( QString( "nCats = %1" ).arg( nCats ) );
for ( int i = 0; i < nCats; i++ )
{
int cat;
Vect_cidx_get_cat_by_index( map()->map(), cidxIndex, i, &cat, 0, 0 );
int cat, type, id;
Vect_cidx_get_cat_by_index( map()->map(), cidxIndex, i, &cat, &type, &id );
QgsFeature feature;
insertAttributes( cat, feature, error );
if ( !error.isEmpty() )
Expand Down

0 comments on commit d26765f

Please sign in to comment.