Skip to content
Permalink
Browse files

Check for raster validity in raster style widget

  • Loading branch information
elpaso committed Nov 3, 2018
1 parent bc424d0 commit 2d1a521fe4473a7805077fc6ab41f8f01035705a
@@ -70,6 +70,8 @@ QgsRasterTransparencyWidget::QgsRasterTransparencyWidget( QgsRasterLayer *layer,

void QgsRasterTransparencyWidget::syncToLayer()
{
if ( ! mRasterLayer->isValid() )
return;
QgsRasterDataProvider *provider = mRasterLayer->dataProvider();
QgsRasterRenderer *renderer = mRasterLayer->renderer();
if ( provider )
@@ -57,7 +57,8 @@ QgsRendererRasterPropertiesWidget::QgsRendererRasterPropertiesWidget( QgsMapLaye

{
mRasterLayer = qobject_cast<QgsRasterLayer *>( layer );
if ( !mRasterLayer )

if ( !( mRasterLayer && mRasterLayer->isValid() ) )
return;

setupUi( this );
@@ -126,6 +127,10 @@ void QgsRendererRasterPropertiesWidget::rendererChanged()

void QgsRendererRasterPropertiesWidget::apply()
{

if ( ! mRasterLayer->isValid() )
return;

mRasterLayer->brightnessFilter()->setBrightness( mSliderBrightness->value() );
mRasterLayer->brightnessFilter()->setContrast( mSliderContrast->value() );

0 comments on commit 2d1a521

Please sign in to comment.
You can’t perform that action at this time.