windows/util: check if failed callback exists before calling

This commit is contained in:
Fleeym 2024-05-16 14:13:41 +03:00
parent 557873db25
commit 49d423dc8c

View file

@ -131,7 +131,9 @@ void file::pickFile(
if (result.isOk()) {
callback(std::move(result.unwrap()));
} else {
failed();
if (failed) {
failed();
}
}
}
Task<Result<ghc::filesystem::path>> file::pick(PickMode mode, FilePickOptions const& options) {
@ -156,7 +158,9 @@ void file::pickFiles(
if (result.isOk()) {
callback(std::move(result.unwrap()));
} else {
failed();
if (failed) {
failed();
}
}
}
Task<Result<std::vector<ghc::filesystem::path>>> file::pickMany(FilePickOptions const& options) {