mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00: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
Notes:
sideshowbarker
2024-07-18 17:20:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2952c86f385
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…
Reference in a new issue