diff --git a/loader/src/platform/mac/util.mm b/loader/src/platform/mac/util.mm index b6a2728f..077c0690 100644 --- a/loader/src/platform/mac/util.mm +++ b/loader/src/platform/mac/util.mm @@ -164,9 +164,10 @@ GEODE_DLL Task> file::pick(file::PickMode mode, fi using RetTask = Task>; [FileDialog dispatchFilePickerWithMode:mode options:options multiple:false onCompletion: ^(FileResult result) { if (result.isOk()) { - return RetTask::immediate(std::move(result.unwrap()[0])); + std::filesystem::path path = result.unwrap()[0]; + return RetTask::immediate(Ok(path)); } else { - return RetTask::immediate(result.err().unwrap()); + return RetTask::immediate(Err(result.err().unwrap())); } }]; } @@ -174,11 +175,7 @@ GEODE_DLL Task> file::pick(file::PickMode mode, fi GEODE_DLL Task>> file::pickMany(file::FilePickOptions const& options) { using RetTask = Task>>; [FileDialog dispatchFilePickerWithMode:mode options:options multiple:true onCompletion: ^(FileResult result) { - if (result.isOk()) { - return RetTask::immediate(result); - } else { - return RetTask::immediate(Err("Couldn't open file")); - } + return RetTask::immediate(result); }]; }