Double check the selected tree item on error activated and error selected callbacks as the value might be nullptr which would cause a crash.
This commit is contained in:
parent
76d0a99707
commit
e0742be4db
@ -1422,6 +1422,10 @@ bool ScriptEditorDebugger::is_skip_breakpoints() {
|
|||||||
void ScriptEditorDebugger::_error_activated() {
|
void ScriptEditorDebugger::_error_activated() {
|
||||||
TreeItem *selected = error_tree->get_selected();
|
TreeItem *selected = error_tree->get_selected();
|
||||||
|
|
||||||
|
if (!selected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
TreeItem *ci = selected->get_first_child();
|
TreeItem *ci = selected->get_first_child();
|
||||||
if (ci) {
|
if (ci) {
|
||||||
selected->set_collapsed(!selected->is_collapsed());
|
selected->set_collapsed(!selected->is_collapsed());
|
||||||
@ -1430,6 +1434,11 @@ void ScriptEditorDebugger::_error_activated() {
|
|||||||
|
|
||||||
void ScriptEditorDebugger::_error_selected() {
|
void ScriptEditorDebugger::_error_selected() {
|
||||||
TreeItem *selected = error_tree->get_selected();
|
TreeItem *selected = error_tree->get_selected();
|
||||||
|
|
||||||
|
if (!selected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Array meta = selected->get_metadata(0);
|
Array meta = selected->get_metadata(0);
|
||||||
if (meta.size() == 0) {
|
if (meta.size() == 0) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user