Skip to content

Commit

Permalink
Check model object in CreateEndpoint to avoid NRE (#16243)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Aug 8, 2024
1 parent 5c45566 commit af518de
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ private static async Task<IResult> HandleAsync(
return httpContext.ChallengeOrForbid("Api");
}

if (model is null)
{
return TypedResults.BadRequest();
}

var contentItem = await contentManager.GetAsync(model.ContentItemId, VersionOptions.DraftRequired);
var modelState = updateModelAccessor.ModelUpdater.ModelState;

Expand Down

0 comments on commit af518de

Please sign in to comment.