Skip to content

Commit b46d337

Browse files
committedSep 25, 2016
[Server 3.0] strict check for QgsApplication
1 parent aeb5ff2 commit b46d337

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/server/qgsserver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ bool QgsServer::sCaptureOutput = true;
7474

7575
QgsServer::QgsServer( bool captureOutput )
7676
{
77-
// Must be already instanciated
78-
if ( qApp == nullptr )
77+
// QgsApplication must exist
78+
if ( qobject_cast<QgsApplication*>( qApp ) == nullptr )
7979
{
80+
qFatal( "A QgsApplication must exist before a QgsServer instance can be created." );
8081
abort();
8182
}
8283
sCaptureOutput = captureOutput;

0 commit comments

Comments
 (0)
Please sign in to comment.