Skip to content

Commit

Permalink
Merge pull request #84897 from raulsntos/dotnet/callp-when-invalid
Browse files Browse the repository at this point in the history
C#: Fail `callp` silently if script is not valid
  • Loading branch information
akien-mga committed Nov 14, 2023
2 parents dcee5cf + 3936871 commit c455cb6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/mono/csharp_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2620,12 +2620,12 @@ MethodInfo CSharpScript::get_method_info(const StringName &p_method) const {
}

Variant CSharpScript::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
ERR_FAIL_COND_V(!valid, Variant());

Variant ret;
bool ok = GDMonoCache::managed_callbacks.ScriptManagerBridge_CallStatic(this, &p_method, p_args, p_argcount, &r_error, &ret);
if (ok) {
return ret;
if (valid) {
Variant ret;
bool ok = GDMonoCache::managed_callbacks.ScriptManagerBridge_CallStatic(this, &p_method, p_args, p_argcount, &r_error, &ret);
if (ok) {
return ret;
}
}

return Script::callp(p_method, p_args, p_argcount, r_error);
Expand Down

0 comments on commit c455cb6

Please sign in to comment.