Skip to content

Commit

Permalink
Fix crashes when accessing null map layer renderer
Browse files Browse the repository at this point in the history
(obviously cached layers have null renderer)

Thanks @nyalldawson for tracking it down
  • Loading branch information
wonder-sk committed Aug 4, 2016
1 parent 669ac1b commit 23909a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsmaprenderercustompainterjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void QgsMapRendererCustomPainterJob::cancel()
for ( LayerRenderJobs::iterator it = mLayerJobs.begin(); it != mLayerJobs.end(); ++it )
{
it->context.setRenderingStopped( true );
if ( it->renderer->feedback() )
if ( it->renderer && it->renderer->feedback() )
it->renderer->feedback()->cancel();
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaprendererparalleljob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void QgsMapRendererParallelJob::cancel()
for ( LayerRenderJobs::iterator it = mLayerJobs.begin(); it != mLayerJobs.end(); ++it )
{
it->context.setRenderingStopped( true );
if ( it->renderer->feedback() )
if ( it->renderer && it->renderer->feedback() )
it->renderer->feedback()->cancel();
}

Expand Down

0 comments on commit 23909a1

Please sign in to comment.