Skip to content

Conversation

@SuthiYuvaraj
Copy link
Contributor

@SuthiYuvaraj SuthiYuvaraj commented Dec 15, 2025

RootCause

FilePicker.PickMultipleAsync() has incorrect nullable reference type annotations causing compiler warnings with #nullable enable. When checking if the result is null, the compiler warns "Expression is always true" because IEnumerable<FileResult?> is not marked nullable, even though the method returns null.

Reason for Regression:

PR #27961 attempted to fix null return behavior but applied the annotation incorrectly, making items nullable (Task<IEnumerable<FileResult?>>) instead of making the collection nullable (Task<IEnumerable<FileResult>?>).

Description of Change:

The fix moves the nullable marker from collection items to the collection itself, changing Task<IEnumerable<FileResult?>> to Task<IEnumerable<FileResult>?> in the IFilePicker interface, FilePicker static class, and FilePickerImplementation class.

Issues Fixed

Fixes #33114

Tested the behaviour on the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Note:

Test Case: Not applicable. This fix corrects nullable annotations only and does not change runtime behavior. The scenario cannot be validated through automated tests.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 15, 2025
@SuthiYuvaraj SuthiYuvaraj changed the title Fix filepicker Fix for FilePicker PickMultipleAsync nullable reference type Dec 15, 2025
@sheiksyedm sheiksyedm marked this pull request as ready for review December 15, 2025 14:52
Copilot AI review requested due to automatic review settings December 15, 2025 14:52
@sheiksyedm sheiksyedm added area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info area-essentials-filepicker labels Dec 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@jfversluis jfversluis self-assigned this Dec 16, 2025
@jfversluis jfversluis added this to the .NET 10.0 SR3 milestone Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info area-essentials-filepicker community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FilePicker PickMultipleAsync nullable reference type

4 participants