Merge pull request #9563 from elpaso/bugfix-unreported-raster-crash-on-bad-layers

Fix crash when opening layer properties on a bad raster layer
This commit is contained in:
Alessandro Pasotti 2019-03-20 07:52:00 +01:00 committed by GitHub
commit 567da1bd79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -833,6 +833,11 @@ void QgsRasterLayerProperties::sync()
*/
void QgsRasterLayerProperties::apply()
{
// Do nothing on "bad" layers
if ( !mRasterLayer->isValid() )
return;
/*
* Legend Tab
*/
@ -1193,7 +1198,7 @@ void QgsRasterLayerProperties::urlClicked( const QUrl &url )
void QgsRasterLayerProperties::mRenderTypeComboBox_currentIndexChanged( int index )
{
if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged )
if ( index < 0 || mDisableRenderTypeComboBoxCurrentIndexChanged || ! mRasterLayer->renderer() )
{
return;
}