From 2902b757e6ddd2de80440b502f7fdcc2a6b06593 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 27 May 2025 17:17:23 +0100 Subject: [PATCH] Added nullguard check to `SaveActiveModsToProfile` --- .../SPTarkov.Server.Core/Controllers/GameController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs index 5905e64e..59cbe466 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs @@ -472,7 +472,11 @@ public class GameController( protected void SaveActiveModsToProfile(SptProfile fullProfile) { fullProfile.SptData!.Mods ??= []; - var mods = _applicationContext?.GetLatestValue(ContextVariableType.LOADED_MOD_ASSEMBLIES).GetValue>(); + var mods = _applicationContext?.GetLatestValue(ContextVariableType.LOADED_MOD_ASSEMBLIES)?.GetValue>(); + if (mods == null) + { + return; + } foreach (var mod in mods) {