Skip to content

Conversation

@PMouse23
Copy link

I had someone with a broken profile. The game client glitched, and he pressed the install/upgrade button for the hideout area upgrade multiple times. Turns out the level is added up before checking the level, resulting in a profile that will not load.

@qodo-free-for-open-source-projects

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Prevent a potential null reference exception

Add a null check for hideoutData.Stages before calling TryGetValue to prevent a
potential NullReferenceException.

Libraries/SPTarkov.Server.Core/Controllers/HideoutController.cs [176-182]

 // Apply bonuses
-if (!hideoutData.Stages.TryGetValue(nextLevel.ToString(), out var hideoutStage))
+if (hideoutData.Stages is null || !hideoutData.Stages.TryGetValue(nextLevel.ToString(), out var hideoutStage))
 {
     logger.Error($"Stage level: {nextLevel} not found for area: {request.AreaType}");
 
     return;
 }
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a potential NullReferenceException if hideoutData.Stages is null and provides a valid fix, which improves the code's robustness.

Low
  • More

@chompDev
Copy link
Contributor

Looks good, can you retarget the development branch please?

@PMouse23 PMouse23 changed the base branch from main to develop January 10, 2026 11:17
@ArchangelWTF ArchangelWTF merged commit 2842ed1 into sp-tarkov:develop Jan 10, 2026
2 of 3 checks passed
@PMouse23 PMouse23 deleted the checkAreaLevelFirst branch January 10, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants