From: Wrexbe (Josh) <81056464+wrexbe@users.noreply.github.com> Date: Sat, 23 Mar 2024 03:55:19 +0000 (-0700) Subject: Fix crash on load when no slot key assigned (#26354) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e69723153dc571e1461c99ac5c7d82a1992e011d;p=space-station-14.git Fix crash on load when no slot key assigned (#26354) Co-authored-by: wrexbe --- diff --git a/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs b/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs index a2aa972625..c5f8adbdea 100644 --- a/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs +++ b/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs @@ -42,11 +42,12 @@ public class ActionButtonContainer : GridContainer { var button = new ActionButton(_entity); - if (keys.TryGetValue(index, out var boundKey)) - { - button.KeyBind = boundKey; + if (!keys.TryGetValue(index, out var boundKey)) + return button; - var binding = _input.GetKeyBinding(boundKey); + button.KeyBind = boundKey; + if (_input.TryGetKeyBinding(boundKey, out var binding)) + { button.Label.Text = binding.GetKeyString(); }