GDScript: Fix assert message when no custom message is set

This commit is contained in:
George Marques 2020-05-26 20:38:44 -03:00
parent 9b3d43cb97
commit f29a2e2606
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 5 additions and 2 deletions

View File

@ -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 {