From 714ce4741d0f6c82455a9dbd4914c240957ec651 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Fri, 19 Mar 2021 17:23:10 +0330 Subject: [PATCH] LibGUI: Allow a wizard page to return null as its next page --- Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp b/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp index 9c51bb832f..7c1754ad1b 100644 --- a/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp +++ b/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp @@ -79,7 +79,11 @@ WizardDialog::WizardDialog(Window* parent_window) if (!current_page().can_go_next()) return done(ExecOK); - push_page(*current_page().next_page()); + auto next_page = current_page().next_page(); + if (!next_page) + return done(ExecOK); + + push_page(*next_page); }; auto& button_spacer = nav_container_widget.add();