Skip to content

Commit

Permalink
don't crash when reply is destroyed while it's waiting for credential…
Browse files Browse the repository at this point in the history
…s to be entered
  • Loading branch information
jef-n committed Apr 5, 2016
1 parent acb9281 commit 10a26e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -10907,8 +10907,9 @@ void QgisApp::namSetup()
#endif
}

void QgisApp::namAuthenticationRequired( QNetworkReply *reply, QAuthenticator *auth )
void QgisApp::namAuthenticationRequired( QNetworkReply *inReply, QAuthenticator *auth )
{
QPointer<QNetworkReply> reply( inReply );
Q_ASSERT( qApp->thread() == QThread::currentThread() );

QString username = auth->user();
Expand Down Expand Up @@ -10943,7 +10944,7 @@ void QgisApp::namAuthenticationRequired( QNetworkReply *reply, QAuthenticator *a
if ( !ok )
return;

if ( reply->isFinished() )
if ( reply.isNull() || reply->isFinished() )
return;

if ( auth->user() != username || ( password != auth->password() && !password.isNull() ) )
Expand Down

0 comments on commit 10a26e6

Please sign in to comment.