summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-04 19:41:24 +0100
committerGitHub <noreply@github.com>2019-01-04 19:41:24 +0100
commit1ba0b2bc0b435c780eebeb7192847e5ef839f8a7 (patch)
tree99e277148a1b44e630c73d7c0a2108738fc77084 /modules/gdscript/gdscript_editor.cpp
parent2c118d754d2022a4d5782d3bd0902cb7cf6f85d8 (diff)
parentd77643562bd484a63492d939354c26360b88b9b1 (diff)
Merge pull request #24741 from timoschwarzer/24697-fix-autocomplete-segfault-in-inner-classes
Fix segfault when trying to autocomplete in inner classes
Diffstat (limited to 'modules/gdscript/gdscript_editor.cpp')
-rw-r--r--modules/gdscript/gdscript_editor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 6f06d518e5..56540b1269 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/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()) {