Merge pull request #115278 from MattiaZir/fix-while-null-node-condition

Parser: Fix "trying to resolve type of null node" when missing condition.
This commit is contained in:
Thaddeus Crews
2026-01-26 13:14:25 -06:00

View File

@@ -2258,7 +2258,7 @@ void GDScriptAnalyzer::resolve_for(GDScriptParser::ForNode *p_for) {
GDScriptParser::DataType list_type;
if (p_for->list) {
resolve_node(p_for->list, false);
reduce_expression(p_for->list);
bool is_range = false;
if (p_for->list->type == GDScriptParser::Node::CALL) {
@@ -2375,8 +2375,7 @@ void GDScriptAnalyzer::resolve_for(GDScriptParser::ForNode *p_for) {
}
void GDScriptAnalyzer::resolve_while(GDScriptParser::WhileNode *p_while) {
resolve_node(p_while->condition, false);
reduce_expression(p_while->condition);
resolve_suite(p_while->loop);
p_while->set_datatype(p_while->loop->get_datatype());
}