mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Browser: Fix crash in Storage Inspector when the cookie list is emtpy
This patch fixes a crash when clicking on an empty cookie list in the Browsers Storage Inspector.
This commit is contained in:
parent
d5aed70dcf
commit
fd628cdfec
Notes:
sideshowbarker
2024-07-19 17:07:40 +09:00
Author: https://github.com/sy-borg 🔰 Commit: https://github.com/SerenityOS/serenity/commit/fd628cdfec7 Pull-request: https://github.com/SerenityOS/serenity/pull/12888
@ -48,7 +48,9 @@ String CookiesModel::column_name(int column) const
|
||||
|
||||
GUI::ModelIndex CookiesModel::index(int row, int column, GUI::ModelIndex const&) const
|
||||
{
|
||||
return create_index(row, column, &m_cookies.at(row));
|
||||
if (static_cast<size_t>(row) < m_cookies.size())
|
||||
return create_index(row, column, &m_cookies.at(row));
|
||||
return {};
|
||||
}
|
||||
|
||||
GUI::Variant CookiesModel::data(GUI::ModelIndex const& index, GUI::ModelRole role) const
|
||||
|
Loading…
Reference in New Issue
Block a user