fix: Range of issues presented by analyzer (#2404)

This commit is contained in:
Armano den Boef
2022-08-01 18:53:22 +02:00
committed by GitHub
parent cfd2662963
commit 902326d1f3
9 changed files with 56 additions and 58 deletions

View File

@@ -9,10 +9,11 @@ namespace Discord.Interactions
public NullableConverter(InteractionService interactionService, IServiceProvider services)
{
var type = Nullable.GetUnderlyingType(typeof(T));
var nullableType = typeof(T);
var type = Nullable.GetUnderlyingType(nullableType);
if (type is null)
throw new ArgumentException($"No type {nameof(TypeConverter)} is defined for this {type.FullName}", "type");
throw new ArgumentException($"No type {nameof(TypeConverter)} is defined for this {nullableType.FullName}", nameof(type));
_typeConverter = interactionService.GetTypeConverter(type, services);
}