diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-06 20:54:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 20:54:03 +0100 |
commit | 393a44b275152c660b2010598661b2730c9c60a8 (patch) | |
tree | d378dfd47952cf57642c1d91be6dad6a8b1e7d4e /modules | |
parent | ad9bf7a5b964201e0e243bbb27c6ab9793dac7de (diff) | |
parent | 4a5d98c98762ea7aab98de184d885cb0e08a5c53 (diff) |
Merge pull request #55213 from Scony/fix-gdscript-crash
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 4 |
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); |