0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 05:10:45 -05:00

Fix: error on profile creation

This commit is contained in:
Dev 2023-03-21 15:22:36 +00:00
parent 1659211080
commit 16e1293d55

View File

@ -318,6 +318,11 @@ export class BotGenerator
*/ */
protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[] protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[]
{ {
if (Object.keys(skills).length === 0)
{
return;
}
// Create a new array of skills with randomised progress value // Create a new array of skills with randomised progress value
return skills.map((skill) => ({ return skills.map((skill) => ({
Id: skill.Id, Id: skill.Id,
@ -325,8 +330,6 @@ export class BotGenerator
})); }));
} }
/** /**
* Generate a random Id for a bot and apply to bots _id and aid value * Generate a random Id for a bot and apply to bots _id and aid value
* @param bot bot to update * @param bot bot to update