Try our conversational search powered by Generative AI!

ServiceAPI: Posting entry price with non-existing entry code returns exception 500 server error

Found in

EPiServer.ServiceApi 5.3.0

Fixed in

EPiServer.ServiceApi 5.3.1

(Or a related package)

Created

Feb 13, 2019

Updated

Mar 04, 2019

State

Closed, Fixed and tested


Description

Steps to reproduce

  1. Create entry price by POST, url/episerverapi/commerce/entries/EntryCode/prices with invalid EntryCode

Expected:
Returns a 404 not found condition.

Actual:
Returns 500 server error with exception:
{
"Message": "An error has occurred.",
"ExceptionMessage": "Object reference not set to an instance of an object.",
"ExceptionType": "System.NullReferenceException",
"StackTrace": " at Mediachase.Commerce.Pricing.Database.PriceDetailDatabase.<>c.<Validate>b__23_0(IPriceDetailValue p)\r\n at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)\r\n at ...