don't abort import if there are entries with invalid groups,

log it and assign them to the root-group
This commit is contained in:
Andreas Piesk 2012-10-28 00:01:01 +02:00 committed by Florian Geyer
parent 22655e67ff
commit 00908856c3

View File

@ -192,9 +192,11 @@ Database* KeePass1Reader::readDatabase(QIODevice* device, const QString& passwor
else { else {
quint32 groupId = m_entryGroupIds.value(entry); quint32 groupId = m_entryGroupIds.value(entry);
if (!m_groupIds.contains(groupId)) { if (!m_groupIds.contains(groupId)) {
return Q_NULLPTR; qWarning("Orphaned entry found, assigning to root group.");
} entry->setGroup(m_db->rootGroup());
} else {
entry->setGroup(m_groupIds.value(groupId)); entry->setGroup(m_groupIds.value(groupId));
}
entry->setUuid(Uuid::random()); entry->setUuid(Uuid::random());
} }
} }