Merge pull request #41760 from ThakeeNathees/null-dereference-on-gdscript-function-fix

null pointer dereference at GDScriptFunction::call crash fix
This commit is contained in:
Rémi Verschelde 2020-09-04 14:45:31 +02:00 committed by GitHub
commit 605d7b7e82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1058,7 +1058,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
err_text = "Got a freed object as a result of the call.";
OPCODE_BREAK;
}
if (obj->is_class_ptr(GDScriptFunctionState::get_class_ptr_static())) {
if (obj && obj->is_class_ptr(GDScriptFunctionState::get_class_ptr_static())) {
err_text = R"(Trying to call an async function without "await".)";
OPCODE_BREAK;
}