LibGUI: Don't update the recent files if we haven't created them yet

We previously assumed that `set_most_recently_open_file()` would only be
called after `Menu::add_recent_files_list()` had been called, and would
crash if we hadn't called it yet. This stops the crash. We're fine to
do this, because we always call `update_recent_file_actions()` in
`register_recent_file_actions()` so it's guaranteed to be up to date
when we do need it.
This commit is contained in:
Sam Atkins 2024-01-19 16:55:30 +00:00 committed by Sam Atkins
parent f8fe6d11b2
commit 343de324db
Notes: sideshowbarker 2024-07-16 20:31:50 +09:00

View file

@ -399,7 +399,8 @@ void Application::set_most_recently_open_file(ByteString new_path)
path);
}
update_recent_file_actions();
if (!m_recent_file_actions.is_empty())
update_recent_file_actions();
}
}