Skip to content

System.NullReferenceException at Microsoft.AspNetCore.Http.DefaultHttpRequest.get_HasFormContentType() #41574

@rexpan

Description

@rexpan

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Sometime I got the error System.NullReferenceException at Microsoft.AspNetCore.Http.DefaultHttpRequest.get_HasFormContentType() for several GET API.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

Error: Object reference not set to an instance of an object.System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.Http.DefaultHttpRequest.get_HasFormContentType()
at Microsoft.AspNetCore.Mvc.ModelBinding.FormValueProviderFactory.CreateValueProviderAsync(ValueProviderFactoryContext context)
at Microsoft.AspNetCore.Mvc.ModelBinding.CompositeValueProvider.CreateAsync(ActionContext actionContext, IList`1 factories)
at Microsoft.AspNetCore.Mvc.ModelBinding.CompositeValueProvider.TryCreateAsync(ActionContext actionContext, IList`1 factories)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()

.NET Version

6.0.202

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions