Skip to content
Permalink
Browse files

Fix crash in standalone apps when no QgsApplication available

  • Loading branch information
nyalldawson committed Dec 5, 2017
1 parent 4671acb commit 9d0b0f27f2e3ed146fbeb6e40adf7bea26153a7c
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/wms/qgswmsprovider.cpp
@@ -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!" );
}

0 comments on commit 9d0b0f2

Please sign in to comment.
You can’t perform that action at this time.