From 7b29584afd2a33ffe1c58a2eaf66c2f511674789 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 23 Oct 2024 22:43:15 +0200 Subject: [PATCH] Fixed profile merge breaking if no main profile is available. --- actors.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/actors.mjs b/actors.mjs index f1794ba..8e9fb5d 100644 --- a/actors.mjs +++ b/actors.mjs @@ -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)