Fixed profile merge breaking if no main profile is available.
This commit is contained in:
parent
e55818ab44
commit
7b29584afd
|
@ -126,6 +126,10 @@ async function fetchProfiles(actorIdsOrNames, { knex }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeMainProfile(profile, mainProfile) {
|
function mergeMainProfile(profile, mainProfile) {
|
||||||
|
if (!mainProfile) {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
|
||||||
const preservedKeys = ['id'];
|
const preservedKeys = ['id'];
|
||||||
|
|
||||||
const mergedProfile = Object.fromEntries(Object.entries(profile).map(([key, value]) => [key, mainProfile[key] === null || preservedKeys.includes(key)
|
const mergedProfile = Object.fromEntries(Object.entries(profile).map(([key, value]) => [key, mainProfile[key] === null || preservedKeys.includes(key)
|
||||||
|
|
Loading…
Reference in New Issue