Skip to content

DocumentBuilder crashes when building Arrays #200

Closed
@shuebner

Description

@shuebner

Method DocumentBuilder.Build(IEnumerable<IIdentifiable> entities):

When entities is an Array (and thus not a generic type) .GenericTypeArguments[0] crashes with IndexOutOfRangeException.

Does anything speak against the following simple fix?

var entitiesType = entities.GetType();
var entityType = entitiesType.IsArray ? entitiesType.GetElementType() : entitiesType.GenericTypeArguments[0];

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions