Skip to content

Commit

Permalink
[raster] fix singleband pseudo-color crash on single-color color pres…
Browse files Browse the repository at this point in the history
…ets ramp
  • Loading branch information
nirvn committed Dec 3, 2016
1 parent 137a211 commit 6009f5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6009f5a

Please sign in to comment.