Skip to content

Commit e385c21

Browse files
committed
Cancel bug fix
1 parent 01cc38a commit e385c21

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/PicView.Avalonia/FileSystem/FilePicker.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,18 @@ public static async Task<string> SelectDirectory()
219219
desktop.MainWindow?.StorageProvider is not { } provider)
220220
throw new NullReferenceException("Missing StorageProvider instance.");
221221

222-
var options = new FolderPickerOpenOptions()
222+
var options = new FolderPickerOpenOptions
223223
{
224224
Title = TranslationHelper.Translation.Folder + " - PicView",
225225
AllowMultiple = false
226226
};
227227

228228
var directory = await provider.OpenFolderPickerAsync(options);
229-
if (directory.Count < 0)
229+
if (directory is null)
230+
{
231+
return "";
232+
}
233+
if (directory.Count <= 0)
230234
{
231235
return "";
232236
}

0 commit comments

Comments
 (0)