Pārlūkot izejas kodu

Merge pull request #24741 from timoschwarzer/24697-fix-autocomplete-segfault-in-inner-classes

Fix segfault when trying to autocomplete in inner classes
Rémi Verschelde 6 gadi atpakaļ
vecāks
revīzija
1ba0b2bc0b
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      modules/gdscript/gdscript_editor.cpp

+ 6 - 2
modules/gdscript/gdscript_editor.cpp

@@ -2442,9 +2442,13 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
 	context._class = parser.get_completion_class();
 	context.block = parser.get_completion_block();
 	context.function = parser.get_completion_function();
-	context.base = p_owner;
-	context.base_path = p_base_path;
 	context.line = parser.get_completion_line();
+
+	if (!context._class) {
+		context.base = p_owner;
+		context.base_path = p_base_path;
+	}
+
 	bool is_function = false;
 
 	switch (parser.get_completion_type()) {