summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorFurkan Türkal <furkan.turkal@hotmail.com>2019-06-22 15:52:51 +0300
committerFurkan Türkal <furkan.turkal@hotmail.com>2019-07-01 14:28:29 +0300
commit7d8d337b2c47df88498067ff9091386691242144 (patch)
tree50dc0cb8fa683586cc947a2994fe48b45bba91b8 /modules
parent30383a1cdc00d398349515b81a85fa1d3da7ae37 (diff)
fix some crashes
Diffstat (limited to 'modules')
-rw-r--r--modules/bullet/rigid_body_bullet.cpp4
-rw-r--r--modules/gdscript/gdscript_function.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 733a900396..085cce9733 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -866,7 +866,7 @@ void RigidBodyBullet::on_enter_area(AreaBullet *p_area) {
if (p_area->is_spOv_gravityPoint()) {
++countGravityPointSpaces;
- assert(0 < countGravityPointSpaces);
+ ERR_FAIL_COND(countGravityPointSpaces <= 0);
}
}
@@ -888,7 +888,7 @@ void RigidBodyBullet::on_exit_area(AreaBullet *p_area) {
if (wasTheAreaFound) {
if (p_area->is_spOv_gravityPoint()) {
--countGravityPointSpaces;
- assert(0 <= countGravityPointSpaces);
+ ERR_FAIL_COND(countGravityPointSpaces < 0);
}
--areaWhereIamCount;
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index bae5eca218..ad48aa1d28 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -1556,14 +1556,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
//error
// function, file, line, error, explanation
String err_file;
- if (p_instance)
+ if (p_instance && p_instance->script->is_valid() && p_instance->script->path != "")
err_file = p_instance->script->path;
else if (script)
err_file = script->path;
if (err_file == "")
err_file = "<built-in>";
String err_func = name;
- if (p_instance && p_instance->script->name != "")
+ if (p_instance && p_instance->script->is_valid() && p_instance->script->name != "")
err_func = p_instance->script->name + "." + err_func;
int err_line = line;
if (err_text == "") {