Be on the safe side, check for null message bar pointer

This commit is contained in:
nirvn 2019-09-17 11:50:23 +07:00 committed by Mathieu Pellerin
parent 74c4f8e3f3
commit 0fcba4ed11

View File

@ -407,7 +407,7 @@ void myMessageOutput( QtMsgType type, const char *msg )
dumpBacktrace( 20 );
// also be super obnoxious -- we DON'T want to allow these errors to be ignored!!
if ( QgisApp::instance() && QgisApp::instance()->thread() == QThread::currentThread() )
if ( QgisApp::instance() && QgisApp::instance()->messageBar() && QgisApp::instance()->thread() == QThread::currentThread() )
{
QgisApp::instance()->messageBar()->pushCritical( QStringLiteral( "Qt" ), msg );
}