[fix-finder] Remove null-forgiving operator from activity names - #12831
Merged
simonrozsival merged 2 commits intoSep 21, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
simonrozsival
approved these changes
Sep 21, 2026
simonrozsival
deleted the
nightly/remove-manifest-null-forgiving-886d293866850b74
branch
September 21, 2026 12:34
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 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.
Problem
AndroidAppManifest.GetLaunchableActivityNames()used the postfix null-forgiving operator to convert filtered nullable XML attribute values to activity names. This violated the repository rule against null-forgiving operators and relied on nullable flow analysis suppression.Fix
Use
OfType<string>()immediately after reading nullable activity name attributes. This removes null values before applying the existing predicates and preserves the returned names and filtering behavior without a null-forgiving operator.Validation
Passed:
AndroidSdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-sdk" AndroidNdkDirectory="$GITHUB_WORKSPACE/bin/Debug/android-ndk" ./build.sh Prepare./dotnet-local.sh test tests/Xamarin.Android.Tools.AndroidSdk-Tests/Xamarin.Android.Tools.AndroidSdk-Tests.csproj -p:AndroidToolsDisableMultiTargeting=false -p:DotNetTargetFrameworkVersion=10.0 --no-restoregit diff --check origin/mainFix-finder metadata
02-null-forgiving-operator30/30(actionability:10, safety:10, scope:10)