Fix error when switching to a screen without an inventory gui widget (#24059)
(cherry picked from commit 6a7f1b2f1f52a8f88f8770a4c695292e5bebedff)
This commit is contained in:
parent
7d019f0418
commit
c0edcf330c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue