mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 16:46:58 +00:00
LibGUI: GFileSystemModel::index() now survives negative inputs
If asked to create an index with negative row and/or column, we should just return an invalid GModelIndex() instead of asserting.
This commit is contained in:
@@ -297,6 +297,8 @@ const GFileSystemModel::Node& GFileSystemModel::node(const GModelIndex& index) c
|
||||
|
||||
GModelIndex GFileSystemModel::index(int row, int column, const GModelIndex& parent) const
|
||||
{
|
||||
if (row < 0 || column < 0)
|
||||
return {};
|
||||
auto& node = this->node(parent);
|
||||
const_cast<Node&>(node).reify_if_needed(*this);
|
||||
if (row >= node.children.size())
|
||||
|
||||
Reference in New Issue
Block a user