Skip to content
Permalink
Browse files

Fix crash with invalid layer

  • Loading branch information
m-kuhn committed Dec 16, 2019
1 parent 3a4b976 commit 8e791807e46779e90b034caa5b5e035874ce255f
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/app/qgslayerstylingwidget.cpp
@@ -200,7 +200,7 @@ void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
transparencyItem->setData( Qt::UserRole, RasterTransparency );
mOptionsListWidget->addItem( transparencyItem );

if ( static_cast<QgsRasterLayer *>( layer )->dataProvider()->capabilities() & QgsRasterDataProvider::Size )
if ( static_cast<QgsRasterLayer *>( layer )->dataProvider() && static_cast<QgsRasterLayer *>( layer )->dataProvider()->capabilities() & QgsRasterDataProvider::Size )
{
QListWidgetItem *histogramItem = new QListWidgetItem( QgsApplication::getThemeIcon( QStringLiteral( "propertyicons/histogram.svg" ) ), QString() );
histogramItem->setData( Qt::UserRole, RasterHistogram );

0 comments on commit 8e79180

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