mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-20 09:21:55 +00:00
Spreadsheet: Use TRY() on file load and save
This commit is contained in:
parent
ca42da23c2
commit
01824fd19a
Notes:
sideshowbarker
2024-07-17 11:34:34 +09:00
Author: https://github.com/krkk
Commit: 01824fd19a
Pull-request: https://github.com/SerenityOS/serenity/pull/14085
Reviewed-by: https://github.com/kennethmyhra ✅
2 changed files with 4 additions and 12 deletions
|
@ -71,10 +71,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->show();
|
||||
|
||||
if (filename) {
|
||||
auto response = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window, filename);
|
||||
if (response.is_error())
|
||||
return 1;
|
||||
spreadsheet_widget.load_file(*response.value());
|
||||
auto file = TRY(FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window, filename));
|
||||
spreadsheet_widget.load_file(file);
|
||||
}
|
||||
|
||||
return app->exec();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue