Fix possible index range error
This commit is contained in:
parent
a46041c958
commit
a490df0f7e
1 changed files with 4 additions and 2 deletions
|
|
@ -318,14 +318,16 @@ namespace LibationWinForms.ProcessQueue
|
||||||
else if (buttonName == nameof(panelClicked.moveUpBtn))
|
else if (buttonName == nameof(panelClicked.moveUpBtn))
|
||||||
{
|
{
|
||||||
Queue.MoveQueuePosition(item, QueuePosition.OneUp);
|
Queue.MoveQueuePosition(item, QueuePosition.OneUp);
|
||||||
UpdateControl(queueIndex - 1);
|
|
||||||
UpdateControl(queueIndex);
|
UpdateControl(queueIndex);
|
||||||
|
if (queueIndex > 0)
|
||||||
|
UpdateControl(queueIndex - 1);
|
||||||
}
|
}
|
||||||
else if (buttonName == nameof(panelClicked.moveDownBtn))
|
else if (buttonName == nameof(panelClicked.moveDownBtn))
|
||||||
{
|
{
|
||||||
Queue.MoveQueuePosition(item, QueuePosition.OneDown);
|
Queue.MoveQueuePosition(item, QueuePosition.OneDown);
|
||||||
UpdateControl(queueIndex + 1);
|
|
||||||
UpdateControl(queueIndex);
|
UpdateControl(queueIndex);
|
||||||
|
if (queueIndex + 1 < Queue.Count)
|
||||||
|
UpdateControl(queueIndex + 1);
|
||||||
}
|
}
|
||||||
else if (buttonName == nameof(panelClicked.moveLastBtn))
|
else if (buttonName == nameof(panelClicked.moveLastBtn))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue