Skip to content
Permalink
Browse files

Fix minimumValue for QgsVectorLayerSelectedFeatureSource

(cherry-picked from 565980f)
  • Loading branch information
nyalldawson committed Jul 4, 2018
1 parent 6659f22 commit 16f15042d4f760f46277b497a933a836b5543408
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsfeaturesource.cpp
@@ -59,7 +59,7 @@ QVariant QgsFeatureSource::minimumValue( int fieldIndex ) const
while ( it.nextFeature( f ) )
{
QVariant v = f.attribute( fieldIndex );
if ( v.isValid() && qgsVariantLessThan( v, min ) )
if ( !v.isNull() && ( qgsVariantLessThan( v, min ) || min.isNull() ) )
{
min = v;
}
@@ -82,7 +82,7 @@ QVariant QgsFeatureSource::maximumValue( int fieldIndex ) const
while ( it.nextFeature( f ) )
{
QVariant v = f.attribute( fieldIndex );
if ( v.isValid() && qgsVariantGreaterThan( v, max ) )
if ( !v.isNull() && ( qgsVariantGreaterThan( v, max ) || max.isNull() ) )
{
max = v;
}

0 comments on commit 16f1504

Please sign in to comment.
You can’t perform that action at this time.