Skip to content

Commit 7313c26

Browse files
committed
Fix WinUI demo null ref exception after cancelling file picker.
1 parent 72f3a65 commit 7313c26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Examples/WinUI/ModelViewer/Services/FilePickerService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task<string> StartFilePicker(string[] filters)
2929
picker.FileTypeFilter.Add(filter);
3030
}
3131
return await picker.PickSingleFileAsync().AsTask().ContinueWith((result) => {
32-
return result is null ? string.Empty : result.Result.Path;
32+
return result is null || result.Result is null ? string.Empty : result.Result.Path;
3333
});
3434
}
3535
}

0 commit comments

Comments
 (0)