Skip to content

Commit

Permalink
Fix crash when changing point cloud to Attribute by Ramp renderer
Browse files Browse the repository at this point in the history
Fixes #42486
  • Loading branch information
nyalldawson committed Mar 26, 2021
1 parent 5f670ce commit f0fb5c8
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -181,7 +181,7 @@ QList<QgsLayerTreeModelLegendNode *> QgsPointCloudAttributeByRampRenderer::creat
case QgsColorRampShader::Interpolated:
// for interpolated shaders we use a ramp legend node unless the settings flag
// to use the continuous legend is not set, in that case we fall through
if ( ! mColorRampShader.legendSettings() || mColorRampShader.legendSettings()->useContinuousLegend() )
if ( mColorRampShader.sourceColorRamp() && ( ! mColorRampShader.legendSettings() || mColorRampShader.legendSettings()->useContinuousLegend() ) )
{
res << new QgsColorRampLegendNode( nodeLayer, mColorRampShader.sourceColorRamp()->clone(),
mColorRampShader.legendSettings() ? *mColorRampShader.legendSettings() : QgsColorRampLegendNodeSettings(),
Expand Down

0 comments on commit f0fb5c8

Please sign in to comment.