Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit db0a6a5

Browse files
committedMar 19, 2019
Fix crash when opening layer propertie on a bad raster layer
unreported ... and hit apply after changing the renderer or the transparency.
1 parent 6c85769 commit db0a6a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,11 @@ void QgsRasterLayerProperties::sync()
833833
*/
834834
void QgsRasterLayerProperties::apply()
835835
{
836+
837+
// Do nothing on "bad" layers
838+
if ( !mRasterLayer->isValid() )
839+
return;
840+
836841
/*
837842
* Legend Tab
838843
*/
@@ -1193,7 +1198,7 @@ void QgsRasterLayerProperties::urlClicked( const QUrl &url )
11931198

11941199
void QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged( int index )
11951200
{
1196-
if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged )
1201+
if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged || ! mRasterLayer->renderer() )
11971202
{
11981203
return;
11991204
}

0 commit comments

Comments
 (0)