Should one try to guard against null reference exceptions / index out of bounds exceptions in MVC views?
问题 I want to post a comment to this question's accepted answer, " Haven't views abandoned code behind now? So what are you going to test? " pointing out that it seems to me as soon as you add an <% if (Model.Thing == "abc") {} %> or @if (Model.Thing == "abc") {} to your view, there exists the potential for something to blow up, and that potential should be guarded against. In regard to the question I linked to, I could see an argument being made that one should guard against the possibility of