Skip to content

Commit d26765f

Browse files
committedOct 9, 2015
[GRASS] fixed crash when adding table for existing features
1 parent c64d5ff commit d26765f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/providers/grass/qgsgrassvectormaplayer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,13 +643,13 @@ void QgsGrassVectorMapLayer::createTable( const QgsFields &fields, QString &erro
643643
mTableFields.append( fields[i] );
644644
mAttributeFields.append( fields[i] );
645645
}
646+
mHasTable = true;
647+
mKeyColumn = 0;
646648
insertCats( error );
647649
if ( !error.isEmpty() )
648650
{
649651
QgsDebugMsg( error );
650652
}
651-
mHasTable = true;
652-
mKeyColumn = 0;
653653
}
654654
QgsDebugMsg( "Table successfully created" );
655655
}
@@ -792,8 +792,8 @@ void QgsGrassVectorMapLayer::insertCats( QString &error )
792792
QgsDebugMsg( QString( "nCats = %1" ).arg( nCats ) );
793793
for ( int i = 0; i < nCats; i++ )
794794
{
795-
int cat;
796-
Vect_cidx_get_cat_by_index( map()->map(), cidxIndex, i, &cat, 0, 0 );
795+
int cat, type, id;
796+
Vect_cidx_get_cat_by_index( map()->map(), cidxIndex, i, &cat, &type, &id );
797797
QgsFeature feature;
798798
insertAttributes( cat, feature, error );
799799
if ( !error.isEmpty() )

0 commit comments

Comments
 (0)
Please sign in to comment.