Browse Source

Fix crash when writing $. in the editor

Julien Nguyen 4 years ago
parent
commit
bf8795c7af
1 changed files with 3 additions and 0 deletions
  1. 3 0
      modules/gdscript/gdscript_analyzer.cpp

+ 3 - 0
modules/gdscript/gdscript_analyzer.cpp

@@ -2728,6 +2728,9 @@ void GDScriptAnalyzer::reduce_self(GDScriptParser::SelfNode *p_self) {
 }
 
 void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscript) {
+	if (p_subscript->base == nullptr) {
+		return;
+	}
 	if (p_subscript->base->type == GDScriptParser::Node::IDENTIFIER) {
 		reduce_identifier(static_cast<GDScriptParser::IdentifierNode *>(p_subscript->base), true);
 	} else {