Merge pull request #10671 from hpvb/fix-10654

Add two missing Null checks
This commit is contained in:
Rémi Verschelde 2017-08-27 02:05:54 +02:00 committed by GitHub
commit 67b152ab49
2 changed files with 10 additions and 3 deletions

View file

@ -1546,7 +1546,9 @@ static void _find_type_arguments(GDCompletionContext &context, const GDParser::N
scr = NULL;
}
} else {
on_script = obj->get_script();
if (obj) {
on_script = obj->get_script();
}
}
}
@ -2237,7 +2239,9 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
scr = NULL;
}
} else {
on_script = obj->get_script();
if (obj) {
on_script = obj->get_script();
}
}
}

View file

@ -1401,8 +1401,11 @@ void SceneTree::_live_edit_create_node_func(const NodePath &p_parent, const Stri
Node *n2 = n->get_node(p_parent);
Node *no = Object::cast_to<Node>(ClassDB::instance(p_type));
no->set_name(p_name);
if (!no) {
continue;
}
no->set_name(p_name);
n2->add_child(no);
}
}