From 2b2810511d5d3a70ac37f0241b764d7526b9dfac Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Tue, 24 Dec 2019 12:17:43 +0100 Subject: [PATCH] KeychainChunk: Fix error handling in ReadJob::slotReadJobDone Signed-off-by: Michael Schuster --- src/gui/creds/keychainchunk.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/creds/keychainchunk.cpp b/src/gui/creds/keychainchunk.cpp index 4115c938d..ceacd27d7 100644 --- a/src/gui/creds/keychainchunk.cpp +++ b/src/gui/creds/keychainchunk.cpp @@ -174,9 +174,6 @@ void ReadJob::slotReadJobDone(QKeychain::Job *incomingJob) QKeychain::ReadPasswordJob *readJob = static_cast(incomingJob); if (readJob) { - _error = readJob->error(); - _errorString = readJob->errorString(); - if (readJob->error() == NoError && readJob->binaryData().length() > 0) { _chunkBuffer.append(readJob->binaryData()); _chunkCount++; @@ -205,7 +202,12 @@ void ReadJob::slotReadJobDone(QKeychain::Job *incomingJob) } #endif } else { + if (readJob->error() != QKeychain::Error::EntryNotFound || + ((readJob->error() == QKeychain::Error::EntryNotFound) && _chunkCount == 0)) { + _error = readJob->error(); + _errorString = readJob->errorString(); qCWarning(lcKeychainChunk) << "Unable to read" << readJob->key() << "chunk" << QString::number(_chunkCount) << readJob->errorString(); + } } readJob->deleteLater(); -- 2.30.2