Fix type conversion error in older Qt versions

This commit is contained in:
Janek Bevendorff 2018-01-07 22:59:59 +01:00 committed by Jonathan White
parent df728083cc
commit c51585c279
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01

View File

@ -65,16 +65,16 @@ QSharedPointer<Kdf> KeePass2::kdfFromParameters(const QVariantMap &p)
{ {
QByteArray uuidBytes = p.value(KDFPARAM_UUID).toByteArray(); QByteArray uuidBytes = p.value(KDFPARAM_UUID).toByteArray();
if (uuidBytes.size() != Uuid::Length) { if (uuidBytes.size() != Uuid::Length) {
return nullptr; return {};
} }
QSharedPointer<Kdf> kdf(uuidToKdf(Uuid(uuidBytes))); QSharedPointer<Kdf> kdf(uuidToKdf(Uuid(uuidBytes)));
if (kdf.isNull()) { if (kdf.isNull()) {
return nullptr; return {};
} }
if (!kdf->processParameters(p)) { if (!kdf->processParameters(p)) {
return nullptr; return {};
} }
return kdf; return kdf;
@ -95,7 +95,7 @@ QSharedPointer<Kdf> KeePass2::uuidToKdf(const Uuid& uuid)
} }
Q_ASSERT_X(false, "uuidToKdf", "Invalid UUID"); Q_ASSERT_X(false, "uuidToKdf", "Invalid UUID");
return nullptr; return {};
} }
KeePass2::ProtectedStreamAlgo KeePass2::idToProtectedStreamAlgo(quint32 id) KeePass2::ProtectedStreamAlgo KeePass2::idToProtectedStreamAlgo(quint32 id)