Fix CheckPreconditions giving empty service provider
Parameter preconditions were always getting the empty service provider, even when a custom one was provided in ExecuteAsync, which means that preconditions which use services cannot work properly.
This commit is contained in:
@@ -42,7 +42,7 @@ namespace Discord.Commands
|
||||
|
||||
public async Task<PreconditionResult> CheckPreconditionsAsync(ICommandContext context, object arg, IServiceProvider services = null)
|
||||
{
|
||||
services = EmptyServiceProvider.Instance;
|
||||
services = services ?? EmptyServiceProvider.Instance;
|
||||
|
||||
foreach (var precondition in Preconditions)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user