This repository was archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
When submitting empty value types, ModelState has a NullRef exception #2720
Comments
This is the exception in CLR (Windows):
|
Thanks very much for filing this bug @sornaks! This bug uncovers at least 3 intertwined issues, most of which are regressions from MVC 5:
|
NTaylorMullen
added a commit
that referenced
this issue
Jul 3, 2015
…o be false when model value is `null` for non-null accepting types. - Previously `ModelBindingResult.IsModelSet` would be set to true if type conversions resulted in empty => `null` values for ValueTypes. This resulted in improper usage of `ModelBindingResult`s creating null ref exceptions in certain cases. - Updated existing functional test to account for new behavior. Previously it was handling the null ref exception by stating that errors were simply invalid; now we can provide a more distinct error. - Added unit test to validate `TypeConverterModelBinder` does what it's supposed to when conversions result in null values. - Added additional integration tests for `TypeConverterModelBinder`. #2720
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The view looks like this:
The Model is this:
NullRef is thrown for -
Height
,Weight
etc. This is the stack trace in mono:The text was updated successfully, but these errors were encountered: