]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix options menu crashing in replays (#26911)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 14 Apr 2024 07:10:37 +0000 (17:10 +1000)
committerGitHub <noreply@github.com>
Sun, 14 Apr 2024 07:10:37 +0000 (09:10 +0200)
Not having the nullable set properly is annoying but fixing that would probably be a significant amount of work.

Content.Client/Options/UI/Tabs/MiscTab.xaml.cs

index 0eff811fa49ce727b513eed22c70f5b84e98ade4..13e3fd05f550ffda0a1af5b6013cb90f154a1265 100644 (file)
@@ -59,8 +59,10 @@ namespace Content.Client.Options.UI.Tabs
                 UpdateApplyButton();
             };
 
-            ShowOocPatronColor.Visible = _playerManager.LocalSession?.Channel.UserData.PatronTier is { } patron;
-            
+            // Channel can be null in replays so.
+            // ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
+            ShowOocPatronColor.Visible = _playerManager.LocalSession?.Channel?.UserData.PatronTier is { };
+
             HudThemeOption.OnItemSelected += OnHudThemeChanged;
             DiscordRich.OnToggled += OnCheckBoxToggled;
             ShowOocPatronColor.OnToggled += OnCheckBoxToggled;