Skip to content

Commit

Permalink
Fix crash in standalone apps when no QgsApplication available
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 5, 2017
1 parent 4671acb commit 9d0b0f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -614,7 +614,7 @@ static void _drawDebugRect( QPainter &p, const QRectF &rect, const QColor &color

QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, int pixelHeight, QgsRasterBlockFeedback *feedback )
{
if ( QgsApplication::instance()->thread() != QThread::currentThread() )
if ( qApp && qApp->thread() != QThread::currentThread() )
{
QgsDebugMsg( "Trying to draw a WMS image on the main thread. Stop it!" );
}
Expand Down

0 comments on commit 9d0b0f2

Please sign in to comment.