Skip to content

Commit bdbc358

Browse files
alexbruynyalldawson
authored andcommittedMay 27, 2019
prevent crash in the color brewer color ramp when requested color
corresponding to the NaN value (fix #29509)
1 parent 06ab26a commit bdbc358

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/core/qgscolorramp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ double QgsColorBrewerColorRamp::value( int index ) const
552552

553553
QColor QgsColorBrewerColorRamp::color( double value ) const
554554
{
555-
if ( mPalette.isEmpty() || value < 0 || value > 1 )
555+
if ( mPalette.isEmpty() || value < 0 || value > 1 || std::isnan( value ) )
556556
return QColor();
557557

558558
int paletteEntry = static_cast< int >( value * mPalette.count() );

0 commit comments

Comments
 (0)
Please sign in to comment.