Skip to content

Commit 5b14e71

Browse files
committed
Anti-Noob: make list of steps to prevent collection modified error.
1 parent 6eef530 commit 5b14e71

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Essentials/AutoCommand.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ internal async void RunNow()
203203
_cTokenSource = new CancellationTokenSource();
204204
var token = _cTokenSource.Token;
205205
_isRunning = true;
206+
var steps = new List<CommandStep>(Steps);
206207
await Task.Run(() =>
207208
{
208-
foreach (var step in Steps)
209+
foreach (var step in steps)
209210
{
210211
if (token.IsCancellationRequested)
211212
{

0 commit comments

Comments
 (0)