1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

Spreadsheet: Use TRY() on file load and save

This commit is contained in:
Karol Kosek 2022-05-22 11:13:46 +02:00 committed by Ali Mohammad Pur
parent ca42da23c2
commit 01824fd19a
2 changed files with 4 additions and 12 deletions

View file

@ -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();