Skip to content

Commit 9d0b0f2

Browse files
committedDec 5, 2017
Fix crash in standalone apps when no QgsApplication available
1 parent 4671acb commit 9d0b0f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static void _drawDebugRect( QPainter &p, const QRectF &rect, const QColor &color
614614

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

0 commit comments

Comments
 (0)
Please sign in to comment.