Skip to content

Commit d7af287

Browse files
authored
Merge pull request #78478 from YuriSizov/gdscript-fix-container-element-cmp
Make container element type comparison safe
2 parents 248e524 + f1e79e2 commit d7af287

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/gdscript/gdscript_analyzer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5003,7 +5003,7 @@ GDScriptParser::DataType GDScriptAnalyzer::get_operation_type(Variant::Operator
50035003
bool hard_operation = p_a.is_hard_type() && p_b.is_hard_type();
50045004

50055005
if (p_operation == Variant::OP_ADD && a_type == Variant::ARRAY && b_type == Variant::ARRAY) {
5006-
if (p_a.get_container_element_type() == p_a.get_container_element_type()) {
5006+
if (p_a.has_container_element_type() && p_b.has_container_element_type() && p_a.get_container_element_type() == p_b.get_container_element_type()) {
50075007
r_valid = true;
50085008
result = p_a;
50095009
result.type_source = hard_operation ? GDScriptParser::DataType::ANNOTATED_INFERRED : GDScriptParser::DataType::INFERRED;

0 commit comments

Comments
 (0)