-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Remove nullabel disable #307
Remove nullabel disable #307
Conversation
First batch of removing nullable disable
Attention this targets the v3 branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool for doing this! I wasn't looking forward to having to 😅
I think we should introduce Try...out in a few places since they are exceptionless.
|
||
if (converter != null) | ||
{ | ||
return ((ICommandConverter<T>)converter).ConvertFrom( | ||
_ = ((ICommandConverter<T>)converter).TryConvertFrom( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't a null
parsedValue
be a false return?
It's been years since I've looked at this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we just handle it a few lines later with a null check. Didn't want to change everything
{ | ||
if (string.IsNullOrWhiteSpace(value)) | ||
{ | ||
return Array.Empty<T>(); | ||
convertedValue = Array.Empty<T>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah.... OK. So in some cases we do and some we don't.
This should be more consistant and return false on empty input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah and in some cases we convert to an struct so there is no null..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna pull this down and have a play.
65ecc76
to
5b6086d
Compare
…kolei/nullable/remove_nullable-disable
…s://github.com/stefannikolei/ImageSharp.Web into stefannikolei/nullable/remove_nullable-disable
I set you on a wild goose chase there sorry! This all looks great. Thanks! 👍 |
All good 😅 I left you one file with #nullable enable for you in the main project |
Prerequisites
Description
Removes the first nullable disable from the code base