mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 21:13:05 +00:00
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:
parent
e2d73eb866
commit
2cd9632c4a
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue