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

Fix for build warning errors when enabling nullable reference types of the project #11894 #11914

Closed
wants to merge 3 commits into from

Conversation

abhipadm
Copy link

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes #11894

Description

Build warning for the nullable context

When enabling nullable context for project (On the Build > General tab of the project properties, enable nullable) will produce nullable warnings. The warnings mentioned below are fixed with this PR.

* CS8602  - Nullable References warning fix
* CS8632  - Nullable annotations context warning fix
* CS8600  - Possible null value to non-nullable type warning fix

@umbrabot
Copy link

Hi there @abhi-debuginside, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@abhipadm abhipadm changed the title V9/temp 11894 Enabling nullable reference types produces build warnings #11894 Jan 28, 2022
@abhipadm abhipadm changed the title Enabling nullable reference types produces build warnings #11894 Fix for build warning errors when enabling nullable reference types of the project #11894 Jan 28, 2022
@abhipadm
Copy link
Author

@nul800sebastiaan Raised a draft PR, please have a look and let me know your thoughts…

@nul800sebastiaan
Copy link
Member

I'm sorry for the very late reply @abhi-debuginside and thank you so much for the effort, you're a star! ⭐

We're working on enabling nullable reference types throughout the whole of Umbraco 10, which is out in a few months. So right now it would not make sense to suppress compiler warnings like in FeatureAuthorizeHandler. So if you can revert that file then we're happy to have the cshtml files adjusted for now.

Let us know when that change is made and we can happily merge this one! 👍 Thanks again!

@nul800sebastiaan
Copy link
Member

Hi again @abhi-debuginside! I've just realized that I've merged #11370 which covers the same area as this PR.
So I'm afraid someone beat you to it! 😅

I'll close this one but we look forward to seeing more of your contributions in the future, thank you very much for this first attempt! 👍

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.

Enabling nullable reference types produces build warnings
3 participants