-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
v10 feature: Nullable reference types #12017
Merged
Zeegaan
merged 24 commits into
v10/dev
from
v10/feature/nullable-reference-types-in-Umbraco-Core
Apr 22, 2022
Merged
v10 feature: Nullable reference types #12017
Zeegaan
merged 24 commits into
v10/dev
from
v10/feature/nullable-reference-types-in-Umbraco-Core
Apr 22, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…le-reference-types-in-Umbraco-Core # Conflicts: # src/Umbraco.Core/Configuration/Models/SecuritySettings.cs # src/Umbraco.Core/Events/DeleteEventArgs.cs # src/Umbraco.Core/Events/IEventDispatcher.cs # src/Umbraco.Core/Events/PassThroughEventDispatcher.cs # src/Umbraco.Core/Events/QueuingEventDispatcherBase.cs # src/Umbraco.Core/IO/MediaFileManager.cs # src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs # src/Umbraco.Core/PropertyEditors/DataValueEditor.cs # src/Umbraco.Core/Routing/DefaultUrlProvider.cs
We still have some problems with the SqlCE project preventing us from building, which is why this PR is still marked as draft 👍 |
Closed
1 task
…le-reference-types-in-Umbraco-Core # Conflicts: # build/build.ps1 # src/Umbraco.Core/Configuration/ConfigConnectionString.cs # src/Umbraco.Core/Configuration/Models/ConnectionStrings.cs # src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs # src/Umbraco.Core/Models/ContentType.cs # src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs # tests/Umbraco.Tests.AcceptanceTest/package.json
Zeegaan
deleted the
v10/feature/nullable-reference-types-in-Umbraco-Core
branch
April 22, 2022 11:58
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes
Add nullabillity to the Core project
Some issues i ran into was nullable properties that was actually not nullable at all, just not initialized anywhere. Lets use UserSave as an example here:
We don't have a constructor for a UserSave, but we do use the json converter to Fill out the model when we get an incoming request, and with the attributes on "Username" we can see that it is required, and therefore it cannot be null.
I've suppressed these nullable warnings for now using
= null!
but it is nonetheless interesting.the compiler doesn't think that string.IsNullOrEmpty() is a null check, so I had to suppress a lot of these warnings.
Also the default ToString() method is now nullable, but it will only ever return null if you yourself overwrite it to do so, which means again a lot of these warnings just has to be suppressed with
!
How to test