Skip to content
Permalink
Browse files

Fix crash with invalid layer

  • Loading branch information
m-kuhn authored and nyalldawson committed Dec 16, 2019
1 parent f6f6bbc commit a6c429a3de8258b19739e78ff35238d3bd3fa3a2
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/app/qgslayerstylingwidget.cpp
@@ -195,7 +195,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 a6c429a

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