Skip to content
Permalink
Browse files

[raster] fix singleband pseudo-color crash on single-color color pres…

…ets ramp
  • Loading branch information
nirvn committed Dec 3, 2016
1 parent 137a211 commit 6009f5a41d6fdbcc5276037c784b0770551f0456
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
@@ -336,7 +336,7 @@ void QgsSingleBandPseudoColorRendererWidget::classify()

if ( mClassificationModeComboBox->currentData().toInt() == Continuous )
{
if ( colorRamp.data() )
if ( colorRamp.data() && colorRamp->count() > 1 )
{
numberOfEntries = colorRamp->count();
entryValues.reserve( numberOfEntries );
@@ -450,7 +450,7 @@ void QgsSingleBandPseudoColorRendererWidget::classify()
}
}

if ( !colorRamp.data() )
if ( !colorRamp.data() || colorRamp->count() == 1 )
{
//hard code color range from blue -> red (previous default)
int colorDiff = 0;

0 comments on commit 6009f5a

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