Fixed profile merge breaking if no main profile is available.

This commit is contained in:
DebaucheryLibrarian 2024-10-23 22:43:15 +02:00
parent e55818ab44
commit 7b29584afd
1 changed files with 4 additions and 0 deletions

View File

@ -126,6 +126,10 @@ async function fetchProfiles(actorIdsOrNames, { knex }) {
}
function mergeMainProfile(profile, mainProfile) {
if (!mainProfile) {
return profile;
}
const preservedKeys = ['id'];
const mergedProfile = Object.fromEntries(Object.entries(profile).map(([key, value]) => [key, mainProfile[key] === null || preservedKeys.includes(key)