fix NRE when adding parameters thru builders (#1946)
This commit is contained in:
@@ -54,7 +54,7 @@ namespace Discord.Commands.Builders
|
|||||||
if (type.GetTypeInfo().IsValueType)
|
if (type.GetTypeInfo().IsValueType)
|
||||||
DefaultValue = Activator.CreateInstance(type);
|
DefaultValue = Activator.CreateInstance(type);
|
||||||
else if (type.IsArray)
|
else if (type.IsArray)
|
||||||
type = ParameterType.GetElementType();
|
DefaultValue = Array.CreateInstance(type.GetElementType(), 0);
|
||||||
ParameterType = type;
|
ParameterType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user