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

TextEditor: Propagate errors from read_file()

This commit is contained in:
Lucas CHOLLET 2023-01-14 18:02:35 -05:00 committed by Jelle Raaijmakers
parent 3454185d08
commit a053807be5
3 changed files with 9 additions and 11 deletions

View file

@ -81,8 +81,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
else
return 1;
} else {
if (!text_widget->read_file(response.value().filename(), response.value().stream()))
return 1;
TRY(text_widget->read_file(response.value().filename(), response.value().stream()));
text_widget->editor().set_cursor_and_focus_line(parsed_argument.line().value_or(1) - 1, parsed_argument.column().value_or(0));
}