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

Solitaire: Make Game creation fallible

This commit is contained in:
Sam Atkins 2023-01-05 17:38:50 +00:00 committed by Linus Groh
parent 6e0ad5536f
commit 306676792c
3 changed files with 27 additions and 20 deletions

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2020, Till Mayer <till.mayer@web.de>
* Copyright (c) 2021, the SerenityOS developers.
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -84,7 +84,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
update_mode(Solitaire::Mode::SingleCardDraw);
auto widget = TRY(window->try_set_main_widget<GUI::Widget>());
widget->load_from_gml(solitaire_gml);
TRY(widget->try_load_from_gml(solitaire_gml));
auto& game = *widget->find_descendant_of_type_named<Solitaire::Game>("game");
game.set_focus(true);