Skip to content

Commit

Permalink
Fix some Coverity null pointer dereference warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 17, 2017
1 parent 6a72c94 commit 952bc02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposerlegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgspalettedrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ void QgsPalettedRendererWidget::loadFromLayer()

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

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

0 comments on commit 952bc02

Please sign in to comment.