aspnet / Mvc

[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
5.62k stars 2.14k forks source link

Remove redundant null check #8624

Closed VPeruS closed 6 years ago

VPeruS commented 6 years ago

new FileStream() will throw with path == null (https://github.com/dotnet/corefx/blob/0bfc4f3cf62f6fc29162ad5b1b89acc14124a375/src/Common/src/CoreLib/System/IO/FileStream.cs#L184)

pranavkm commented 6 years ago

Thanks for your PR. However, in MVC, we generally prefer throwing as close to the calling code as possible. The current code is fine as it is.