Skip to content
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

Issue#63 - Adding Nullable checks #74

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shubham-sonthalia
Copy link

@shubham-sonthalia shubham-sonthalia commented Feb 23, 2024

Screenshot 2024-02-23 at 11 04 28 AM

@shubham-sonthalia
Copy link
Author

Hi @rubo @flcl42 kindly review the PR for resolving the build warnings for nullable references.

Copy link
Contributor

@flcl42 flcl42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check the entire solution if possible? dotnet build .\src\libp2p\Libp2p.sln reports more issues

src/libp2p/Libp2p.Core/PeerFactory.cs Show resolved Hide resolved
@shubham-sonthalia
Copy link
Author

Hey @flcl42, for the solution level, I was previously getting 60 warnings. I have reduced them down to 25 now. But now, I am not sure about the null checks because they are causing some other issues when adding nullables there.

@flcl42
Copy link
Contributor

flcl42 commented Feb 26, 2024

Hey @flcl42, for the solution level, I was previously getting 60 warnings. I have reduced them down to 25 now. But now, I am not sure about the null checks because they are causing some other issues when adding nullables there.

You can propose solution and let me help you with comments

}
if (!channel.IsClosed)
if (channel != null && !channel.IsClosed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

channel is not nullable, so you can omit this check

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants