mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:57:46 +00: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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue