Debugger: Fix crash in symbol tree menu code

This commit is contained in:
chaoticgd 2024-10-07 23:47:06 +01:00 committed by Ty
parent 62f20a4809
commit 60abebb3a5
2 changed files with 7 additions and 0 deletions

View File

@ -154,6 +154,11 @@ void CpuWidget::setupSymbolTrees()
m_local_variable_tree = new LocalVariableTreeWidget(m_cpu);
m_parameter_variable_tree = new ParameterVariableTreeWidget(m_cpu);
m_function_tree->updateModel();
m_global_variable_tree->updateModel();
m_local_variable_tree->updateModel();
m_parameter_variable_tree->updateModel();
m_ui.tabFunctions->layout()->addWidget(m_function_tree);
m_ui.tabGlobalVariables->layout()->addWidget(m_global_variable_tree);
m_ui.tabLocalVariables->layout()->addWidget(m_local_variable_tree);

View File

@ -445,6 +445,8 @@ void SymbolTreeWidget::setupMenu()
void SymbolTreeWidget::openMenu(QPoint pos)
{
SymbolTreeNode* node = currentNode();
if (!node)
return;
bool node_is_object = node->tag == SymbolTreeNode::OBJECT;
bool node_is_symbol = node->symbol.valid();