Skip to content

Commit 6009f5a

Browse files
committed
[raster] fix singleband pseudo-color crash on single-color color presets ramp
1 parent 137a211 commit 6009f5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void QgsSingleBandPseudoColorRendererWidget::classify()
336336

337337
if ( mClassificationModeComboBox->currentData().toInt() == Continuous )
338338
{
339-
if ( colorRamp.data() )
339+
if ( colorRamp.data() && colorRamp->count() > 1 )
340340
{
341341
numberOfEntries = colorRamp->count();
342342
entryValues.reserve( numberOfEntries );
@@ -450,7 +450,7 @@ void QgsSingleBandPseudoColorRendererWidget::classify()
450450
}
451451
}
452452

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

0 commit comments

Comments
 (0)