diff options
author | Itamar <itamar8910@gmail.com> | 2021-06-04 19:34:24 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-04 19:29:22 +0200 |
commit | c1b20036877fe43e86ca8803994a5477546bf289 (patch) | |
tree | d7cad739285784c5f59ec3036dc89ba09db0c7db /Userland/DevTools | |
parent | 2b762ef94075b8a6e1ae8dd61e535b6b6cf7c064 (diff) | |
download | serenity-c1b20036877fe43e86ca8803994a5477546bf289.zip |
HackStudio: Use Node's name when inserting to the ClassView tree
Previously, when traversing the ClassView tree to find the parent of a
new node, we used the name of the node's declaration to find the path
to the parent in the tree.
However, some nodes in the tree do not have a matching declaration,
which caused a VERIFY failure.
To fix this, we now use the node's name when walking the tree.
We can do this because the node's name should be identical to the name
of its declaration.
Closes #7702.
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/HackStudio/ClassViewWidget.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/ClassViewWidget.cpp b/Userland/DevTools/HackStudio/ClassViewWidget.cpp index f9d6f06adf..acf180e57c 100644 --- a/Userland/DevTools/HackStudio/ClassViewWidget.cpp +++ b/Userland/DevTools/HackStudio/ClassViewWidget.cpp @@ -147,8 +147,7 @@ void ClassViewModel::add_declaration(const GUI::AutocompleteProvider::Declaratio auto& scope = scope_parts[i]; ClassViewNode* next { nullptr }; for (auto& child : parent->children) { - VERIFY(child.declaration); - if (child.declaration->name == scope) { + if (child.name == scope) { next = &child; break; } |