mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-10-20 04:42:46 -04:00
Fix NRE on cancel when there's nothing to cancel.
This commit is contained in:
1 parent
91db665428
commit
e787d33e5a
1 file changed
+4
-2
@@ -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