Skip to content
Permalink
Browse files

Fix minimumValue for QgsVectorLayerSelectedFeatureSource

  • Loading branch information
nyalldawson committed Jul 4, 2018
1 parent ef6df0f commit 565980f6a1b250dedc2a44f66421d1f72f8140a4
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsfeaturesource.cpp
@@ -64,7 +64,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;
}
@@ -87,7 +87,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 565980f

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