Skip to content

Enable nullable reference types in WaitForAppDetection.cs#11713

Merged
simonrozsival merged 3 commits into
mainfrom
copilot/fix-finder-enable-nullable-reference-types
Jun 23, 2026
Merged

Enable nullable reference types in WaitForAppDetection.cs#11713
simonrozsival merged 3 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
@jonathanpeppers jonathanpeppers marked this pull request as ready for review June 23, 2026 14:49
Copilot AI review requested due to automatic review settings June 23, 2026 14:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Opts the shipped WaitForAppDetection MSBuild task into nullable reference types to accurately represent that its cached getPackagesAsync task may be absent when no task object is registered.

Changes:

  • Enabled nullable reference types in WaitForAppDetection.cs via #nullable enable.
  • Marked the getPackagesAsync field as nullable to match the existing null guard in RunTaskAsync ().

@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jun 23, 2026
@simonrozsival simonrozsival merged commit 7ab8bac into main Jun 23, 2026
42 checks passed
@simonrozsival simonrozsival deleted the copilot/fix-finder-enable-nullable-reference-types branch June 23, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants