mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
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:
parent
f8fe6d11b2
commit
343de324db
Notes:
sideshowbarker
2024-07-16 20:31:50 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/343de324db Pull-request: https://github.com/SerenityOS/serenity/pull/22866
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue