Fixed permissions

This commit is contained in:
Kwoth 2017-01-02 10:56:24 +01:00
parent faea4b03ee
commit 9b89d6a7f8

View File

@ -10,7 +10,7 @@ namespace NadekoBot.TypeReaders
public override Task<TypeReaderResult> Read(ICommandContext context, string input)
{
input = input.ToUpperInvariant();
var module = NadekoBot.CommandService.Modules.GroupBy(m => m.GetTopLevelModule()).FirstOrDefault(m => m.Key.Name.ToUpperInvariant() == input);
var module = NadekoBot.CommandService.Modules.GroupBy(m => m.GetTopLevelModule()).FirstOrDefault(m => m.Key.Name.ToUpperInvariant() == input)?.Key;
if (module == null)
return Task.FromResult(TypeReaderResult.FromError(CommandError.ParseFailed, "No such module found."));