diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs index c139166dc..195bd5c58 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs @@ -99,7 +99,15 @@ namespace Barotrauma internal set { _isCsEnabledForSession?.TrySetValue(value); - if (_isCsEnabledForSession != null) { ConfigService.SaveConfigValue(_isCsEnabledForSession); } + if (_isCsEnabledForSession != null) + { + if (_isCsEnabledForSession.GetConfigInfo() == null) + { + Logger.LogError($"Config info was nil while trying to save {IsCsEnabledForSession}"); + return; + } + ConfigService.SaveConfigValue(_isCsEnabledForSession); + } } }