mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:57:45 +00:00
Flood: Propagate errors when creating SettingsDialog
This commit is contained in:
parent
239293a8b4
commit
8434b3a0c6
3 changed files with 24 additions and 10 deletions
|
@ -108,7 +108,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
update();
|
||||
|
||||
auto change_settings = [&] {
|
||||
auto settings_dialog = SettingsDialog::construct(window, board_rows, board_columns);
|
||||
auto settings_dialog_or_error = SettingsDialog::try_create(window, board_rows, board_columns);
|
||||
if (settings_dialog_or_error.is_error()) {
|
||||
GUI::MessageBox::show(window, "Failed to load the settings window"sv, "Unable to Open Settings"sv, GUI::MessageBox::Type::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
auto settings_dialog = settings_dialog_or_error.release_value();
|
||||
if (settings_dialog->exec() != GUI::Dialog::ExecResult::OK)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue