New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullReferenceException related to sorting/paging #229
Labels
bug 🐞
Something isn't working
Comments
Can you create a PR with the fix and ask @maznag to review ? |
I will do that this weekend |
ivanmonteiro
added a commit
to ivanmonteiro/jhipster-dotnetcore
that referenced
this issue
May 31, 2020
The code that calls the GetParameterValues method throws NullReferenceException because it expects a string[] not null. Fix jhipster#229
4 tasks
maznag
added a commit
that referenced
this issue
Jun 1, 2020
Fix #229 - NullReferenceException related to sorting/paging
nicolas63
pushed a commit
to nicolas63/jhipster-dotnetcore
that referenced
this issue
Jun 29, 2020
The code that calls the GetParameterValues method throws NullReferenceException because it expects a string[] not null. Fix jhipster#229
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview of the issue
I get the following NullReferenceException when viewing any listing page:
Exception has occurred: CLR/System.NullReferenceException
Ocorreu uma exceção do tipo "System.NullReferenceException" em JHipsterNet.dll, mas ela não foi manipulada no código do usuário: 'Object reference not set to an instance of an object.'
em JHipsterNet.Pagination.Binders.PageableBinder.ResolveSortArgument(QueryString queryString) em src\JHipsterNet\Pagination\Binders\PageableBinder.cs:linha 57
em JHipsterNet.Pagination.Binders.PageableBinder.ResolvePageableArgumentFromQueryString(QueryString queryString) em src\JHipsterNet\Pagination\Binders\PageableBinder.cs:linha 34
em JHipsterNet.Pagination.Binders.PageableBinder.BindModelAsync(ModelBindingContext bindingContext) em src\JHipsterNet\Pagination\Binders\PageableBinder.cs:linha 20
em Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder.d__2.MoveNext()
Motivation for or Use Case
Reproduce the error
Using the latest master version, create some entities and go to the listing page of any of the created entities and the exception is thrown on the backend
Related issues
#176
Suggest a Fix
On QueryStringExtensions.cs file change GetParameterValues method:
To this:
So the code that uses this method can safely run a foreach with the result without a null reference exeption.
JHipster Version(s)
JHipster configuration
Using master version of this repository
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
The text was updated successfully, but these errors were encountered: