Browse Source

Missing .Value before returning it

pull/516/head
Paulo Anjos 8 years ago
parent
commit
e8074d394a
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Discord.Net.Commands/CommandService.cs

+ 3
- 3
src/Discord.Net.Commands/CommandService.cs View File

@@ -254,7 +254,7 @@ namespace Discord.Commands
{ {
if (commands.Count == 1) if (commands.Count == 1)
return preconditionResult; return preconditionResult;
else if (secondOption != null) //we already got our last hope, so we can skip
else if (secondOption != null) //we already got our second option, so we can skip
continue; continue;
} }
var parseResult = await commands[i].ParseAsync(context, searchResult).ConfigureAwait(false); var parseResult = await commands[i].ParseAsync(context, searchResult).ConfigureAwait(false);
@@ -276,7 +276,7 @@ namespace Discord.Commands
{ {
if (commands.Count == 1) if (commands.Count == 1)
return parseResult; return parseResult;
else if (secondOption != null) //we already got our last hope, so we can skip
else if (secondOption != null) //we already got our second option, so we can skip
continue; continue;
} }
} }
@@ -288,7 +288,7 @@ namespace Discord.Commands
} }


if (secondOption != null) if (secondOption != null)
return secondOption;
return secondOption.Value;
return SearchResult.FromError(CommandError.UnknownCommand, "This input does not match any overload."); return SearchResult.FromError(CommandError.UnknownCommand, "This input does not match any overload.");
} }
} }


Loading…
Cancel
Save