Qt: Fix working with no gpgconf in CryptoConfig
* lang/qt/src/cryptoconfig.cpp (CryptoConfig::entry): Add nullptr checks. -- This fixes a crash when gpgconf is not found. When every return value is NULL. GnuPG-Bug-Id: T6131
This commit is contained in:
parent
7e2ef54b9c
commit
586846209b
@ -56,10 +56,11 @@ QVariant CryptoConfigEntry::defaultValue() const
|
||||
QGpgME::CryptoConfigEntry *CryptoConfig::entry(const QString &componentName, const QString &entryName) const
|
||||
{
|
||||
const CryptoConfigComponent *comp = component(componentName);
|
||||
const QStringList groupNames = comp->groupList();
|
||||
const QStringList groupNames = comp ? comp->groupList() : QStringList();
|
||||
for (const auto &groupName : groupNames) {
|
||||
const CryptoConfigGroup *group = comp ? comp->group(groupName) : nullptr;
|
||||
if (CryptoConfigEntry *entry = group->entry(entryName)) {
|
||||
const CryptoConfigGroup *group = comp->group(groupName);
|
||||
CryptoConfigEntry *entry = group ? group->entry(entryName) : nullptr;
|
||||
if (entry) {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user