Skip to content

FilePicker PickMultipleAsync nullable reference type #27710

@aalsamoht

Description

@aalsamoht

Description

FilePicker.PickMultipleAsync() can return null.
The documentation is correct, but the nullable reference type annotation for the return value is wrong.

https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.storage.filepicker.pickmultipleasync?view=net-maui-9.0#microsoft-maui-storage-filepicker-pickmultipleasync(microsoft-maui-storage-pickoptions)

Steps to Reproduce

var fileResults = await filePicker.PickMultipleAsync(PickOptions.Default);

// Warning: Expression is always true according to nullable reference types' annotations
if (fileResults is not null)
{
   // Some code
}

Link to public reproduction project repository

No response

Version with bug

8.0.100 SR10

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

iOS, Android, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infoarea-essentials-filepickerpartner/syncfusionIssues / PR's with Syncfusion collaborationt/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions