diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs index 877441f706c..6c47ffad1de 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs @@ -46,6 +46,11 @@ private static async Task 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;