Repository navigation
[fix-finder] Remove redundant null-forgiving operator - #12818
Merged
simonrozsival merged 1 commit intoSep 18, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-actions
Bot
requested review from
jonathanpeppers and
simonrozsival
as code owners
September 18, 2026 02:15
simonrozsival
approved these changes
Sep 18, 2026
simonrozsival
deleted the
nightly/remove-null-forgiving-attribute-eb88ff8f7e3a80d6
branch
September 18, 2026 05:31
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
GetRequiredAttributeused a null-forgiving operator even though the precedingIsNullOrWhiteSpaceguard uses the repository's[NotNullWhen(false)]-annotated extension and already proves the value is non-null. This violated the repository rule against null-forgiving operators and left a redundant suppression in shipped build tooling.Fix
Return the proven non-null attribute value directly in
src/Xamarin.Android.Build.Tasks/Utilities/UtilityExtensions.cs, preserving the existing control flow and exception behavior.Validation
AndroidSdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-sdk" AndroidNdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-ndk" ./build.sh Prepare— passed./dotnet-local.sh— passedGRADLE_USER_HOME=/tmp/gh-aw/agent/gradle ./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj --no-restore --nologo --verbosity:minimal --maxcpucount:1 -p:BuildProjectReferences=false -p:AndroidSdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-sdk" -p:AndroidNdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-ndk"— passed with 0 errorsgit diff --check— passedFix-finder metadata
02-null-forgiving-operator30/30(actionability:10, safety:10, scope:10)