Skip to content

Commit

Permalink
Merge pull request #33427 from m-kuhn/fix_crash_with_invalid_raster_l…
Browse files Browse the repository at this point in the history
…ayer

Fix crash with invalid layer
  • Loading branch information
m-kuhn committed Dec 16, 2019
2 parents 3a4b976 + 8e79180 commit 78ad518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgslayerstylingwidget.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 78ad518

Please sign in to comment.