mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-02-19 07:50:47 +01:00
Fix NRE on cancel when there's nothing to cancel.
This commit is contained in:
@@ -212,7 +212,8 @@ namespace LibationWinForms.ProcessQueue
|
||||
private async void cancelAllBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
Queue.ClearQueue();
|
||||
await Queue.Current?.CancelAsync();
|
||||
if (Queue.Current is not null)
|
||||
await Queue.Current.CancelAsync();
|
||||
virtualFlowControl2.VirtualControlCount = Queue.Count;
|
||||
UpdateAllControls();
|
||||
}
|
||||
@@ -331,7 +332,8 @@ namespace LibationWinForms.ProcessQueue
|
||||
ProcessBook item = Queue[queueIndex];
|
||||
if (buttonName == nameof(panelClicked.cancelBtn))
|
||||
{
|
||||
await item.CancelAsync();
|
||||
if (item is not null)
|
||||
await item.CancelAsync();
|
||||
Queue.RemoveQueued(item);
|
||||
virtualFlowControl2.VirtualControlCount = Queue.Count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user