From 24d5bf8173648671ac2c72bbe3631c09f924c555 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 8 Mar 2023 20:51:25 +0000 Subject: HackStudio: Store correct address in ClassViewModel's ModelIndices When 359d6e7b0b0ef7add9eb2015d0dd664a82cf73d7 happened, the return value of `children[row]` went from being `ClassViewNode&` to `NonnullOwnPtr&`, so we were putting the wrong address into the ModelIndex's data. --- Userland/DevTools/HackStudio/ClassViewWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/DevTools') 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(parent_index.internal_data()); - auto* child = &parent->children[row]; + auto* child = parent->children[row].ptr(); return create_index(row, column, child); } -- cgit v1.2.3