mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
LibGUI/Application: Resize recent files list to max open file size
Since it's possible to have the actual recently opened files < max_recently_open_files(), which causes us to crash when we try to access new_recent_files_list where index >= the list's size.
This commit is contained in:
parent
2de9ffa632
commit
111e4162d0
1 changed files with 1 additions and 0 deletions
|
@ -388,6 +388,7 @@ void Application::set_most_recently_open_file(ByteString new_path)
|
|||
});
|
||||
|
||||
new_recent_files_list.prepend(new_path);
|
||||
new_recent_files_list.resize(max_recently_open_files());
|
||||
|
||||
for (size_t i = 0; i < max_recently_open_files(); ++i) {
|
||||
auto& path = new_recent_files_list[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue