summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-06 20:54:03 +0100
committerGitHub <noreply@github.com>2022-01-06 20:54:03 +0100
commit393a44b275152c660b2010598661b2730c9c60a8 (patch)
treed378dfd47952cf57642c1d91be6dad6a8b1e7d4e /modules
parentad9bf7a5b964201e0e243bbb27c6ab9793dac7de (diff)
parent4a5d98c98762ea7aab98de184d885cb0e08a5c53 (diff)
Merge pull request #55213 from Scony/fix-gdscript-crash
Diffstat (limited to 'modules')
-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 81aaef09dc..9db76861ff 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/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);