mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-25 19:02:07 -05:00
Profiler: Don't try to create a DisassemblyModel for invalid indices
This fixes a null dereference when toggling the "top functions" mode while a top-level process node was selected.
This commit is contained in:
parent
2ec302ea22
commit
2952c86f38
1 changed files with 4 additions and 1 deletions
|
@ -465,7 +465,10 @@ void Profile::set_disassembly_index(const GUI::ModelIndex& index)
|
|||
return;
|
||||
m_disassembly_index = index;
|
||||
auto* node = static_cast<ProfileNode*>(index.internal_data());
|
||||
m_disassembly_model = DisassemblyModel::create(*this, *node);
|
||||
if (!node)
|
||||
m_disassembly_model = nullptr;
|
||||
else
|
||||
m_disassembly_model = DisassemblyModel::create(*this, *node);
|
||||
}
|
||||
|
||||
GUI::Model* Profile::disassembly_model()
|
||||
|
|
Loading…
Add table
Reference in a new issue