summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBojidar Marinov <bojidar.marinov.bg@gmail.com>2020-01-16 22:12:24 +0200
committerBojidar Marinov <bojidar.marinov.bg@gmail.com>2020-01-16 22:12:24 +0200
commitda5b138e642b358ab7cecf22e0cbf4a0b85b9dc7 (patch)
treef0813a5024197e56b45c6202ce8a6ad2a32089a4 /modules
parent3af0400a32a2f81aad0b56940af0d6a92b6ffc92 (diff)
Fix errors raised when showing parse errors in the editor
Fixes #26691
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript.cpp2
-rw-r--r--modules/gdscript/gdscript_editor.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 8abf2ee7ca..fd86bc4e14 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -320,7 +320,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) {
if (!ClassDB::is_parent_class(p_this->get_class_name(), top->native->get_name())) {
if (ScriptDebugger::get_singleton()) {
- GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), 0, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'");
+ GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), 1, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'");
}
ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type '" + p_this->get_class() + "'" + ".");
}
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index e2f2b7fc3b..c7e5387072 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -335,7 +335,9 @@ void GDScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *
ScriptInstance *GDScriptLanguage::debug_get_stack_level_instance(int p_level) {
- ERR_FAIL_COND_V(_debug_parse_err_line >= 0, NULL);
+ if (_debug_parse_err_line >= 0)
+ return NULL;
+
ERR_FAIL_INDEX_V(p_level, _debug_call_stack_pos, NULL);
int l = _debug_call_stack_pos - p_level - 1;