]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix crash on load when no slot key assigned (#26354)
authorWrexbe (Josh) <81056464+wrexbe@users.noreply.github.com>
Sat, 23 Mar 2024 03:55:19 +0000 (20:55 -0700)
committerGitHub <noreply@github.com>
Sat, 23 Mar 2024 03:55:19 +0000 (14:55 +1100)
Co-authored-by: wrexbe <wrexbe@protonmail.com>
Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs

index a2aa972625d6eebd41bc3163d27b816a4f03db87..c5f8adbdea3bc5f1fde3dda52b8d07370bffef4c 100644 (file)
@@ -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();
             }