Add safety check so this stops crashing when we look at it the wrong way

This commit is contained in:
Evil Factory
2026-04-11 23:32:40 -03:00
parent 1b8bcf4052
commit c5976ccae1

View File

@@ -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);
}
}
}