Skip to content

Commit

Permalink
improve PrimitiveGet->Array
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 25, 2024
1 parent c4b141a commit 578a758
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/src/primitive/partials/PrimitiveGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,13 @@ public object Array(Type type)
if (type == null) return null;
if (!type.IsArray) return null;
Type childrenType = type.GetElementType();
Type listType = typeof(List<>).MakeGenericType(childrenType);

try
{
if (!IsValidPrefix(Prefix.Array)) throw new InvalidDataException();

var list = new List<object>();
var list = (List<dynamic>)Activator.CreateInstance(listType);

var objectCount = BitConverter.ToInt32(VaultArray, Position);
Position += sizeof(int);
Expand Down

0 comments on commit 578a758

Please sign in to comment.