From 45e58894f24896b61ca7c12752431c10b43542a0 Mon Sep 17 00:00:00 2001 From: IlmrynX Date: Sun, 5 Feb 2017 21:36:24 -0500 Subject: [PATCH] Fix issue with precondition checking Previously `commands.Count` would never change, so by the current logic it was never checking the last command. Fixes: https://github.com/RogueException/Discord.Net/issues/514 --- src/Discord.Net.Commands/CommandService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index 9f6e66c20..1a17c36ab 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -250,7 +250,7 @@ namespace Discord.Commands var preconditionResult = await commands[i].CheckPreconditionsAsync(context, dependencyMap).ConfigureAwait(false); if (!preconditionResult.IsSuccess) { - if (commands.Count == 1) + if (i == 1) return preconditionResult; else continue;