GDScript: Fix assert message when no custom message is set

(cherry picked from commit f29a2e2606)
This commit is contained in:
George Marques 2020-05-26 20:38:44 -03:00 committed by Rémi Verschelde
parent 1642c4163d
commit a8332e30f0
1 changed files with 5 additions and 2 deletions

View File

@ -1501,11 +1501,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 {