summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-05-26 20:38:44 -0300
committerGeorge Marques <george@gmarqu.es>2020-05-26 20:40:59 -0300
commitf29a2e2606317e0964ffed287187afe6bf115626 (patch)
tree1d14f83fe015fc4ecde5d78759c6964187e5a799 /modules/gdscript
parent9b3d43cb974dd3407fd0936e486e34b8cec436e7 (diff)
GDScript: Fix assert message when no custom message is set
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_function.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index 92e07ab874..8445eee1fa 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -1430,11 +1430,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#ifdef DEBUG_ENABLED
GET_VARIANT_PTR(test, 1);
- GET_VARIANT_PTR(message, 2);
bool result = test->booleanize();
if (!result) {
- const String &message_str = *message;
+ String message_str;
+ if (_code_ptr[ip + 2] != 0) {
+ GET_VARIANT_PTR(message, 2);
+ message_str = *message;
+ }
if (message_str.empty()) {
err_text = "Assertion failed.";
} else {