Correct overzealous refactor

This commit is contained in:
vuurvlieg 2024-03-25 15:08:13 +01:00
parent 6a0a78b870
commit 0d3a3e9df8
2 changed files with 6 additions and 2 deletions

View File

@ -1267,7 +1267,9 @@ void Entry::setGroup(Group* group, bool trackPrevious)
m_group->database()->addDeletedObject(m_uuid); m_group->database()->addDeletedObject(m_uuid);
// copy custom icon to the new database // copy custom icon to the new database
group->database()->metadata()->copyCustomIcon(iconUuid(), m_group->database()->metadata()); if (group->database()) {
group->database()->metadata()->copyCustomIcon(iconUuid(), m_group->database()->metadata());
}
} else if (trackPrevious && m_group->database() && group != m_group) { } else if (trackPrevious && m_group->database() && group != m_group) {
setPreviousParentGroup(m_group); setPreviousParentGroup(m_group);
} }

View File

@ -469,7 +469,9 @@ void Group::setParent(Group* parent, int index, bool trackPrevious)
recCreateDelObjects(); recCreateDelObjects();
// copy custom icon to the new database // copy custom icon to the new database
parent->m_db->metadata()->copyCustomIcon(iconUuid(), m_db->metadata()); if (parent->m_db) {
parent->m_db->metadata()->copyCustomIcon(iconUuid(), m_db->metadata());
}
} }
if (m_db != parent->m_db) { if (m_db != parent->m_db) {
connectDatabaseSignalsRecursive(parent->m_db); connectDatabaseSignalsRecursive(parent->m_db);