Fixed profile creation failing when player alt+f4s partially through profile creation process

Added nullguard to `userbuilds` code inside `checkForOrphanedModdedItems()`
This commit is contained in:
Dev 2024-05-07 09:02:44 +01:00
parent f991382d66
commit eb0fb09a37

View File

@ -897,6 +897,8 @@ export class ProfileFixerService
}
}
if (fullProfile.userbuilds)
{
// Remove invalid builds from weapon, equipment and magazine build lists
const weaponBuilds = fullProfile.userbuilds?.weaponBuilds || [];
fullProfile.userbuilds.weaponBuilds = weaponBuilds.filter((weaponBuild) =>
@ -915,6 +917,7 @@ export class ProfileFixerService
{
return !this.shouldRemoveMagazineBuild(magazineBuild, itemsDb);
});
}
// Iterate over dialogs, looking for messages with items not found in item db, remove message if item found
for (const dialogId in fullProfile.dialogues)