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 authored and nirvn committed Mar 26, 2021
1 parent a15d881 commit 924c70d
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 924c70d

Please sign in to comment.