]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix error when switching to a screen without an inventory gui widget (#24059)
authorDrSmugleaf <DrSmugleaf@users.noreply.github.com>
Sun, 14 Jan 2024 03:18:28 +0000 (19:18 -0800)
committerGitHub <noreply@github.com>
Sun, 14 Jan 2024 03:18:28 +0000 (14:18 +1100)
Content.Client/UserInterface/Systems/Inventory/InventoryUIController.cs

index b20f926761fa3c6ad8780ce1e40dc0f6e4ffb11f..5b461c76887c39b53aa6c3efcf704133c04f888e 100644 (file)
@@ -57,8 +57,8 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
         if (UIManager.ActiveScreen == null)
             return;
 
-        var inventoryGui = UIManager.GetActiveUIWidget<InventoryGui>();
-        RegisterInventoryButton(inventoryGui.InventoryButton);
+        if (UIManager.GetActiveUIWidgetOrNull<InventoryGui>() is { } inventoryGui)
+            RegisterInventoryButton(inventoryGui.InventoryButton);
     }
 
     public void OnStateEntered(GameplayState state)