Skip to content
Permalink
Browse files

Fix crash with legend creation of raster singleband pseudocolor renderer

  • Loading branch information
nirvn authored and nyalldawson committed Dec 18, 2020
1 parent 2787545 commit d6e2cd04efac53df04d317df18e7b50ca5e55bae
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/core/raster/qgssinglebandpseudocolorrenderer.cpp
@@ -441,6 +441,17 @@ QList<QgsLayerTreeModelLegendNode *> QgsSingleBandPseudoColorRenderer::createLeg
res << new QgsSimpleLegendNode( nodeLayer, name );
}

if ( !rampShader->sourceColorRamp() )
{
const QList< QPair< QString, QColor > > items = legendSymbologyItems();
res.reserve( items.size() );
for ( const QPair< QString, QColor > &item : items )
{
res << new QgsRasterSymbolLegendNode( nodeLayer, item.second, item.first );
}
return res;
}

switch ( rampShader->colorRampType() )
{
case QgsColorRampShader::Interpolated:

0 comments on commit d6e2cd0

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