Skip to content

Missing null check in ParseSortParameters #543

Closed
@ghost

Description

Description

Hi all,
When requesting using a query string with an empty sort segment, e.g.
/api/...?sort=
or
/api/...?sort=text,,number,
a 500 is thrown instead of gracefully handling the exception. This seems to be because there's a missing null check here.

I'd imagine that the intended behaviour should be to skip over this if block in the case that the sortSegment is null, however I could imagine that preventing empty sort segments at this point could also be beneficial.

Environment

  • JsonApiDotNetCore Version: 3.1.0, 4.0.0-alpha3
  • Other Relevant Package Versions:

Metadata

Metadata

Assignees

No one assigned

    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