fix audio.add (#1121)

* fix audio.add

* Fix settype to allow Null

* thx celestora <3

* Finaly, Tarhun
This commit is contained in:
Ry0 2024-07-01 22:43:56 +03:00 committed by GitHub
parent 8786bd36fb
commit 9d62bfc12e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -234,8 +234,14 @@ final class VKAPIPresenter extends OpenVKPresenter
} }
try { try {
// Проверка типа параметра
$type = $parameter->getType();
if (($type && !$type->isBuiltin()) || is_null($val)) {
$params[] = $val;
} else {
settype($val, $parameter->getType()->getName()); settype($val, $parameter->getType()->getName());
$params[] = $val; $params[] = $val;
}
} catch (\Throwable $e) { } catch (\Throwable $e) {
// Just ignore the exception, since // Just ignore the exception, since
// some args are intended for internal use // some args are intended for internal use