From 96be35d2c1fc6fb62f0defcda38b18decdaa7eed Mon Sep 17 00:00:00 2001 From: Chomp Date: Sat, 26 Jul 2025 12:54:46 +0100 Subject: [PATCH] FIxed skill check error in `GetCompleteProfile` --- .../Controllers/ProfileController.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs b/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs index 9ededf44..24741c8a 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/ProfileController.cs @@ -103,16 +103,19 @@ public class ProfileController( // Some users like to crank massive skill multipliers and send the client invalid information, // causing a json exception during parsing - if (profile[0].Skills != null) + if (profile.Any()) { - // Pmc profile is index 0 - profileFixerService.CheckForSkillsOverMaxLevel(profile[0]); - } + if (profile[0].Skills != null) + { + // Pmc profile is index 0 + profileFixerService.CheckForSkillsOverMaxLevel(profile[0]); + } - if (profile[1].Skills != null) - { - // We also do the scav profile here because it is also affected by the skill multipliers - profileFixerService.CheckForSkillsOverMaxLevel(profile[1]); + if (profile[1].Skills != null) + { + // We also do the scav profile here because it is also affected by the skill multipliers + profileFixerService.CheckForSkillsOverMaxLevel(profile[1]); + } } return profile;