Fix error when switching to a screen without an inventory gui widget (#24059)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user