-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ArgumentNullException when returning empty ViewResult #3284
Comments
I was having a discussion about this with @MartinJohns in jabbr, and he's saying that this worked in earlier builds before we added argument validation. Maybe it was dumb-luck that it worked before, but this would be convenient for POCO controllers. It's odd to require view data to be explicitly managed by the user when they are using view models for everything they show on the view. |
@rynowak I think this could at a minimum be changed to fail a bit more gracefully by perhaps failing earlier with a better error. But do you feel that some un-set values could just be silently ignored for scenarios such as POCO controllers? |
That's what I'm suggesting - if you're not directly using a feature like |
Ok so pass in a dummy ViewData if it isn't there? |
yes |
Similar with temp data also if we can |
|
Closed in #3310 |
Having the following code:
Results in an
ArgumentNullException
:Running on the latest version:
In an older version this still worked.
The text was updated successfully, but these errors were encountered: