-
Notifications
You must be signed in to change notification settings - Fork 22
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
Exception when file name is null #9
Comments
Umm. Good catch! @gfoidl I assume this shouldn't be nullable? 🤔 |
It depends on your design. Usually methods like TrySomething allows nulls. GetMimeType should throw ArgumentNullException for null string (because string supports Null Object Pattern - string.Empty). So I think you should remove ? from method signature. |
Yeah, @ekisielinski is correct. We should remove the Sorry, that's my fault. My brain was at a preview-stage of nullability and didn't update to the release along the way with updated guidlines on how to annotate... |
Closed with 5d4e0de |
v2.0.2 is now on NuGet 🙌 |
If method signature allows null string, why it throws exception?
MimeTypes/src/MimeTypes/MimeTypes.cs.pp
Line 1057 in d1e9e37
The text was updated successfully, but these errors were encountered: