Skip to content

Commit

Permalink
fix NRE when adding parameters thru builders (discord-net#1946)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinchs authored Nov 25, 2021
1 parent d5f5ae1 commit 143ca6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Discord.Net.Commands/Builders/ParameterBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal void SetType(Type type)
if (type.GetTypeInfo().IsValueType)
DefaultValue = Activator.CreateInstance(type);
else if (type.IsArray)
type = ParameterType.GetElementType();
DefaultValue = Array.CreateInstance(type.GetElementType(), 0);
ParameterType = type;
}

Expand Down

0 comments on commit 143ca6d

Please sign in to comment.