-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add project file and modernize code #10975
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
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.
This is great. I had a lot of small suggestions that would do more modernization to the code, if you want.
snippets/csharp/System/NullReferenceException/Overview/Array1.cs
Outdated
Show resolved
Hide resolved
snippets/csharp/System/NullReferenceException/Overview/Array2.cs
Outdated
Show resolved
Hide resolved
snippets/csharp/System/NullReferenceException/Overview/Chain1.cs
Outdated
Show resolved
Hide resolved
snippets/csharp/System/NullReferenceException/Overview/Chain1.cs
Outdated
Show resolved
Hide resolved
snippets/csharp/System/NullReferenceException/Overview/Chain2.cs
Outdated
Show resolved
Hide resolved
Page current = pages.CurrentPage; | ||
if (current != 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.
Something here seems off if nullable references are enabled. Either current
should be a Page?
or the null check isn't needed.
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 have now explicitly disabled nullable context for the purpose of the examples. Can you review my most recent commit, especially the note I added to the NRE examples in the .xml file?
snippets/csharp/System/NullReferenceException/Overview/nullreturn2.cs
Outdated
Show resolved
Hide resolved
snippets/csharp/System/NullReferenceException/Overview/nullreturn2a.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Bill Wagner <[email protected]>
Created this PR to allow #10967 to pass status checks.
(Hide whitespace changes.)