浏览代码

Merge pull request #55213 from Scony/fix-gdscript-crash

Rémi Verschelde 3 年之前
父节点
当前提交
393a44b275
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      modules/gdscript/gdscript_editor.cpp

+ 4 - 0
modules/gdscript/gdscript_editor.cpp

@@ -1164,6 +1164,10 @@ static bool _guess_method_return_type_from_base(GDScriptParser::CompletionContex
 static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, const GDScriptParser::ExpressionNode *p_expression, GDScriptCompletionIdentifier &r_type) {
 	bool found = false;
 
+	if (p_expression == nullptr) {
+		return false;
+	}
+
 	if (p_expression->is_constant) {
 		// Already has a value, so just use that.
 		r_type = _type_from_variant(p_expression->reduced_value);