Skip to content

Commit

Permalink
Fix crash in ticket #3528
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15305 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 1, 2011
1 parent 44441de commit b055bdc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -908,7 +908,12 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV
uniqueValues.clear();

// get the field name
const QgsField & fld = field( index );
QgsFieldMap::const_iterator fieldIt = attributeFields.find( index );
if ( fieldIt == attributeFields.constEnd() )
{
return; //invalid field
}
const QgsField& fld = fieldIt.value();

sql = QString( "SELECT DISTINCT %1 FROM %2 ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery );

Expand Down

0 comments on commit b055bdc

Please sign in to comment.