Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Resolve discord-net#936

* Remember to not search *only* typereaders for primitives 😒
  • Loading branch information
Joe4evr authored and FiniteReality committed May 5, 2018
1 parent 8ab2b19 commit 0383fd6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,8 @@ private static void BuildParameter(ParameterBuilder builder, System.Reflection.P

if (builder.TypeReader == null)
{
var readers = service.GetTypeReaders(paramType);
TypeReader reader = null;

if (readers != null)
reader = readers.FirstOrDefault().Value;
else
reader = service.GetDefaultTypeReader(paramType);

builder.TypeReader = reader;
builder.TypeReader = service.GetDefaultTypeReader(paramType)
?? service.GetTypeReaders(paramType)?.FirstOrDefault().Value;
}
}

Expand Down

0 comments on commit 0383fd6

Please sign in to comment.