Fix segfault when trying to autocomplete in inner classes

Fixes #24697
This commit is contained in:
Timo Schwarzer 2019-01-03 15:51:34 +01:00
parent 200be0795d
commit d77643562b
No known key found for this signature in database
GPG Key ID: C4062DA320280737
1 changed files with 6 additions and 2 deletions

View File

@ -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.line = parser.get_completion_line();
if (!context._class) {
context.base = p_owner;
context.base_path = p_base_path;
context.line = parser.get_completion_line();
}
bool is_function = false;
switch (parser.get_completion_type()) {