From 2ff9c8dfb9243f95be32a1681bc66c662d0416aa Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Thu, 1 May 2025 20:21:59 -0400 Subject: [PATCH] Fix vending machine manager wire error (#37100) Skip updating amounts for removed entries --- Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs b/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs index 899a0208cb..41d29e8080 100644 --- a/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs +++ b/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs @@ -10,6 +10,7 @@ using Robust.Client.UserInterface; using Content.Client.UserInterface.Controls; using Content.Shared.IdentityManagement; using Robust.Client.Graphics; +using Robust.Shared.Utility; namespace Content.Client.VendingMachines.UI { @@ -162,7 +163,9 @@ namespace Content.Client.VendingMachines.UI continue; var dummy = _dummies[proto]; - var amount = cachedInventory.First(o => o.ID == proto).Amount; + if (!cachedInventory.TryFirstOrDefault(o => o.ID == proto, out var entry)) + continue; + var amount = entry.Amount; // Could be better? Problem is all inventory entries get squashed. var text = GetItemText(dummy, amount); -- 2.51.2