summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-21 15:24:07 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-21 15:24:07 +0100
commit9ecb39fc2313d109767d662fdaf7255a1d3a2aef (patch)
tree4fcb81eda40d106148e9fdec1f0a543eba107dca
parentafe1c89fb5af11fe7e38d01ad09bfafa8f9b493f (diff)
parent4a8276a7734ffb532e24aa77506df756860a78fb (diff)
Merge pull request #68952 from Chaosus/gds_fix_completion_crash
Fix GDScript completion crash
-rw-r--r--modules/gdscript/gdscript_editor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 48a6e3fb51..7628bffd22 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -2512,7 +2512,7 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c
}
static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, const GDScriptParser::SubscriptNode *p_subscript, GDScriptParser::DataType &r_base_type, Variant *r_base = nullptr) {
- if (p_subscript->base->type == GDScriptParser::Node::IDENTIFIER) {
+ if (p_subscript->base->type == GDScriptParser::Node::IDENTIFIER && p_context.base != nullptr) {
const GDScriptParser::GetNodeNode *get_node = nullptr;
const GDScriptParser::IdentifierNode *identifier_node = static_cast<GDScriptParser::IdentifierNode *>(p_subscript->base);