mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +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
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…
Add table
Add a link
Reference in a new issue