Skip to content

Commit 7c4c7e8

Browse files
committedFeb 17, 2014
network authentication: don't crash if a network request is closed while the credentials dialog is open (fixes #9379)
1 parent 7becd76 commit 7c4c7e8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9474,6 +9474,9 @@ void QgisApp::namAuthenticationRequired( QNetworkReply *reply, QAuthenticator *a
94749474
if ( !ok )
94759475
return;
94769476

9477+
if( reply->isFinished() )
9478+
return;
9479+
94779480
auth->setUser( username );
94789481
auth->setPassword( password );
94799482
}

‎src/core/qgsnetworkaccessmanager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ void QgsNetworkAccessManager::abortRequest()
183183

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

186-
reply->abort();
186+
if( reply->isRunning() )
187+
reply->close();
187188
}
188189

189190
QString QgsNetworkAccessManager::cacheLoadControlName( QNetworkRequest::CacheLoadControl theControl )

0 commit comments

Comments
 (0)
Please sign in to comment.