diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index d797991ad1..3b035f8b36 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -1694,7 +1694,7 @@ void ClientSideEncryption::decryptPrivateKey(const AccountPtr &account, const QB _privateKey = privateKey; } else { const auto deprecatedSha1PrivateKey = EncryptionHelper::decryptPrivateKey(deprecatedSha1Password, key); - if (!privateKey.isEmpty()) { + if (!deprecatedSha1PrivateKey.isEmpty()) { _privateKey = deprecatedSha1PrivateKey; } else { _privateKey = EncryptionHelper::decryptPrivateKey(deprecatedPassword, key);