Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 10, 2019
1 parent b4d764a commit e8b057b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgslegendrenderer.cpp
Expand Up @@ -380,7 +380,7 @@ QSizeF QgsLegendRenderer::drawTitleInternal( QgsRenderContext *context, QPainter
QStringList lines = mSettings.splitStringForWrapping( mSettings.title() );
double y = point.y();

if ( context )
if ( context && context->painter() )
{
context->painter()->setPen( mSettings.fontColor() );
}
Expand Down Expand Up @@ -420,7 +420,7 @@ QSizeF QgsLegendRenderer::drawTitleInternal( QgsRenderContext *context, QPainter

QRectF r( textBoxLeft, y, textBoxWidth, height );

if ( context->painter() )
if ( context && context->painter() )
{
mSettings.drawText( context->painter(), r, *titlePart, titleFont, halignment, Qt::AlignVCenter, Qt::TextDontClip );
}
Expand Down

0 comments on commit e8b057b

Please sign in to comment.