Requests over the size limit (default 30,000,000 bytes) are causing errors by returning null view models. Previously these requests would have caused a BadHttpRequestException however with an update to .Net those exceptions are being caught and a Model State error is returned with no view data. This is resulting in null reference exceptions to occur when trying to access the model. Instead the request methods should be returning a friendly error message informing users of the file size restriction. Additionally a JavaScript check on file size should be done when files are selected to preemptively catch errors before the forms submitted.
dotnet/aspnetcore#36214 (comment)
Requests over the size limit (default 30,000,000 bytes) are causing errors by returning null view models. Previously these requests would have caused a BadHttpRequestException however with an update to .Net those exceptions are being caught and a Model State error is returned with no view data. This is resulting in null reference exceptions to occur when trying to access the model. Instead the request methods should be returning a friendly error message informing users of the file size restriction. Additionally a JavaScript check on file size should be done when files are selected to preemptively catch errors before the forms submitted.
dotnet/aspnetcore#36214 (comment)