Previewing a filter definition returns 500 server error if parameters = null

Found in

EPiServer.Profiles 1.1.0

Fixed in

EPiServer.Profiles.Client 1.13.1

Created

Oct 01, 2019

Updated

Jan 24, 2020

State

Closed, Fixed and tested


Description

1. Create a profile filter definition as below:

POST/{{urlFilterDefinitions}}
{
  "Name": "PFDGetSpecificuser2",
  "Description": "PFDspecificuser",
  "Query": "Name eq 'PHAMNGOCDIEPv0.1'",
  "Category": "TopEvents",
  "Type": "profiles"
}

It returns a result:

{
    "Id": "fd_PFDGetSpecificuser2",
    "Name": "PFDGetSpecificuser2",
    "Description": "PFDspecificuser",
    "Query": "Name eq 'PHAMNGOCDIEPv0.1'",
    "Parameters": null,
    "Category": "TopEvents",
    "Type": "Profiles"
}

2. Preview the definition above by:

POST/{{urlFilterDefinitions}}/fd_PFDGetSpecificuser2/preview
{
    "Parameters": null
}

Actual:
It returns the 500 code, Server error.
Note: If you change the value of the parameter from null to {},it works fine

Expected:
The parameters should be validated when you create a filter definition step (step1).
A better message and appropriate response code should be provided.