Skip to content

Crash on nested null IEnumerable #392

@agenceplus-emillon

Description

@agenceplus-emillon

On a resolver returning a collection of objects containing nested collections of object, the query raise an ArgumentNullException if a property value is null and queried on.

Example:

class Text {
  public string Value { get; set; }
}
class Result {
  public IEnumerable<Text>? Texts { get; set; }
}

From debugging in the stack trace it appears the generated dynamic expression is something like that:
results.SelectWithNullCheck(r => r.Texts.Select(t => t.Value))

This need to generate instead:
results.SelectWithNullCheck(r => r.Texts.SelectWithNullCheck(t => t.Value))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions