summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorPawel Lampe <pawel.lampe@gmail.com>2021-11-21 20:58:52 +0100
committerPawel Lampe <pawel.lampe@gmail.com>2021-11-21 20:58:52 +0100
commit4a5d98c98762ea7aab98de184d885cb0e08a5c53 (patch)
tree7a625e12f9c84cc57d8128cba3138bd48fc0fd00 /modules/gdscript
parented02b8af59fceb48798c857306335fe0f7ff6a8a (diff)
Fix godot crash on null expression, fixes #53862
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_editor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 71d2699c2e..2f33740079 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -1182,6 +1182,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);