Skip to content

Enable nullable reference types in WaitForAppDetection.cs#11713

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types
Draft

Enable nullable reference types in WaitForAppDetection.cs#11713
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Opts the shipped WaitForAppDetection MSBuild task into nullable reference types, making explicit the existing contract that its single field can legitimately be null. Follows the conversion of its sibling DetectIfAppWasUninstalled.cs (#11598), which deferred this file.

Changes

  • Added #nullable enable as the first line of src/Xamarin.Android.Build.Debugging.Tasks/Tasks/WaitForAppDetection.cs.
  • Marked getPackagesAsync nullable, reflecting that GetRegisteredTaskObjectAssemblyLocal<T> returns null when nothing is registered:
System.Threading.Tasks.Task<List<AndroidInstalledPackage>>? getPackagesAsync;

The existing if (getPackagesAsync == null) return; guard in RunTaskAsync () already covers the null case, so no further changes were needed. No null-forgiving (!) operator is used; the project targets netstandard2.0, so ArgumentNullException.ThrowIfNull is not applicable.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable nullable reference types in WaitForAppDetection.cs Enable nullable reference types in WaitForAppDetection.cs Jun 23, 2026
Copilot AI requested a review from jonathanpeppers June 23, 2026 02:52
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.

2 participants