1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Small fixes to unrechable code, possibly overflows, using NULL pointers

This commit is contained in:
qarmin
2019-06-03 21:52:50 +02:00
parent 8c923fc617
commit 8245db869f
18 changed files with 48 additions and 70 deletions

View File

@@ -394,15 +394,17 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
if (p_node != get_scene_node() && !p_node->get_owner()) {
if (!p_node || (p_node != get_scene_node() && !p_node->get_owner())) {
return;
}
TreeItem *item = p_node ? _find(tree->get_root(), p_node->get_path()) : NULL;
TreeItem *item = _find(tree->get_root(), p_node->get_path());
if (!item) {
return;
}
int idx = item->get_button_by_id(0, BUTTON_VISIBILITY);
ERR_FAIL_COND(idx == -1);