mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
PDFViewer: Create OutlineModel items with the correct pointer
This fixes a bug where we would construct a ModelIndex with a pointer to NonnullRefPtr<OutlineItem>, instead of a pointer to the underlying OutlineItem, which caused a crash later on when we would try to dereference that pointer.
This commit is contained in:
parent
fcd4e68959
commit
0d46c27741
1 changed files with 2 additions and 2 deletions
|
@ -130,8 +130,8 @@ GUI::ModelIndex OutlineModel::parent_index(const GUI::ModelIndex& index) const
|
|||
GUI::ModelIndex OutlineModel::index(int row, int column, const GUI::ModelIndex& parent) const
|
||||
{
|
||||
if (!parent.is_valid())
|
||||
return create_index(row, column, &m_outline->children[row]);
|
||||
return create_index(row, column, m_outline->children[row].ptr());
|
||||
|
||||
auto parent_outline_item = static_cast<PDF::OutlineItem*>(parent.internal_data());
|
||||
return create_index(row, column, &parent_outline_item->children[row]);
|
||||
return create_index(row, column, parent_outline_item->children[row].ptr());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue