MailBox fix (#4377)

* Catches Out Of Bounds error on ListBox SelectedIndex for when the B_PartyDown_Click event is triggered and the current Selection is in LB_PCBOX.
This commit is contained in:
santacrab2 2024-10-28 19:21:44 -04:00 committed by GitHub
parent e2d73eb866
commit 2cd9632c4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -586,6 +586,8 @@ public partial class SAV_MailBox : Form
private void SwapSlots(ListBox lb, bool down)
{
if (lb.SelectedIndex == -1)
return;
int index = lb.SelectedIndex;
var otherIndex = index + (down ? 1 : -1);
if ((uint)otherIndex >= lb.Items.Count)