diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-03-08 20:51:25 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-08 23:14:21 +0100 |
commit | 24d5bf8173648671ac2c72bbe3631c09f924c555 (patch) | |
tree | be7d488716ac3f562a24592789ebe852fd3aac6c /Userland/DevTools | |
parent | 1393ed2000a9a7baf0bc54039781d4262924689d (diff) | |
download | serenity-24d5bf8173648671ac2c72bbe3631c09f924c555.zip |
HackStudio: Store correct address in ClassViewModel's ModelIndices
When 359d6e7b0b0ef7add9eb2015d0dd664a82cf73d7 happened, the return value
of `children[row]` went from being `ClassViewNode&` to
`NonnullOwnPtr<ClassViewNode>&`, so we were putting the wrong address
into the ModelIndex's data.
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/HackStudio/ClassViewWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/ClassViewWidget.cpp b/Userland/DevTools/HackStudio/ClassViewWidget.cpp index da16e72703..d27c5dd3d3 100644 --- a/Userland/DevTools/HackStudio/ClassViewWidget.cpp +++ b/Userland/DevTools/HackStudio/ClassViewWidget.cpp @@ -91,9 +91,9 @@ GUI::ModelIndex ClassViewModel::parent_index(const GUI::ModelIndex& index) const GUI::ModelIndex ClassViewModel::index(int row, int column, const GUI::ModelIndex& parent_index) const { if (!parent_index.is_valid()) - return create_index(row, column, &m_root_scope[row]); + return create_index(row, column, m_root_scope[row].ptr()); auto* parent = static_cast<ClassViewNode const*>(parent_index.internal_data()); - auto* child = &parent->children[row]; + auto* child = parent->children[row].ptr(); return create_index(row, column, child); } |