Skip to content
Permalink
Browse files
Fix some Coverity null pointer dereference warnings
  • Loading branch information
nyalldawson committed Apr 17, 2017
1 parent 6a72c94 commit 952bc02144688366282ae52ef769f29bdb6d3486
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/composer/qgscomposerlegend.cpp
  2. +1 −1 src/gui/raster/qgspalettedrendererwidget.cpp
@@ -218,7 +218,7 @@ bool QgsComposerLegend::resizeToContents() const

void QgsComposerLegend::setCustomLayerTree( QgsLayerTree *rootGroup )
{
mLegendModel->setRootGroup( rootGroup ? rootGroup : mComposition->project()->layerTreeRoot() );
mLegendModel->setRootGroup( rootGroup ? rootGroup : ( mComposition ? mComposition->project()->layerTreeRoot() : nullptr ) );

mCustomLayerTree.reset( rootGroup );
}
@@ -439,7 +439,7 @@ void QgsPalettedRendererWidget::loadFromLayer()

void QgsPalettedRendererWidget::gatheredClasses()
{
if ( mGatherer && mGatherer->wasCanceled() )
if ( !mGatherer || mGatherer->wasCanceled() )
return;

mModel->setClassData( mGatherer->classes() );

0 comments on commit 952bc02

Please sign in to comment.