Skip to content

Commit

Permalink
[afs] Fix crash when requesting invalid feature ID
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 20, 2018
1 parent 87207dd commit 922776b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/providers/arcgisrest/qgsafsshareddata.cpp
Expand Up @@ -52,9 +52,15 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
objectIds.reserve( stopId );
for ( int i = startId; i < stopId; ++i )
{
objectIds.append( mObjectIds[i] );
if ( i >= 0 && i < mObjectIds.count() )
objectIds.append( mObjectIds[i] );
}

if ( objectIds.empty() )
{
QgsDebugMsg( "No valid features IDs to fetch" );
return false;
}

// Query
QString errorTitle, errorMessage;
Expand Down

0 comments on commit 922776b

Please sign in to comment.