Skip to content

Commit

Permalink
Fix crash when opening layer propertie on a bad raster layer
Browse files Browse the repository at this point in the history
unreported

... and hit apply after changing the renderer or the
transparency.
  • Loading branch information
elpaso committed Mar 19, 2019
1 parent 6c85769 commit db0a6a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -833,6 +833,11 @@ void QgsRasterLayerProperties::sync()
*/ */
void QgsRasterLayerProperties::apply() void QgsRasterLayerProperties::apply()
{ {

// Do nothing on "bad" layers
if ( !mRasterLayer->isValid() )
return;

/* /*
* Legend Tab * Legend Tab
*/ */
Expand Down Expand Up @@ -1193,7 +1198,7 @@ void QgsRasterLayerProperties::urlClicked( const QUrl &url )


void QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged( int index ) void QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged( int index )
{ {
if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged ) if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged || ! mRasterLayer->renderer() )
{ {
return; return;
} }
Expand Down

0 comments on commit db0a6a5

Please sign in to comment.