Skip to content

Commit

Permalink
network authentication: don't crash if a network request is closed wh…
Browse files Browse the repository at this point in the history
…ile the credentials dialog is open (fixes #9379)
  • Loading branch information
jef-n committed Feb 17, 2014
1 parent 7becd76 commit 7c4c7e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9474,6 +9474,9 @@ void QgisApp::namAuthenticationRequired( QNetworkReply *reply, QAuthenticator *a
if ( !ok )
return;

if( reply->isFinished() )
return;

auth->setUser( username );
auth->setPassword( password );
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsnetworkaccessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ void QgsNetworkAccessManager::abortRequest()

QgsMessageLog::logMessage( tr( "Network request %1 timed out" ).arg( reply->url().toString() ), tr( "Network" ) );

reply->abort();
if( reply->isRunning() )
reply->close();
}

QString QgsNetworkAccessManager::cacheLoadControlName( QNetworkRequest::CacheLoadControl theControl )
Expand Down

0 comments on commit 7c4c7e8

Please sign in to comment.