mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-04 04:37:46 +08:00
Fixed parent class does not exists in Hyperf\GrpcServer\CoreMiddleware
. (#1572)
示例代码: https://github.com/nfangxu/hyperf-demo/blob/bug-grpc-di/app/Controller/HiController.php
This commit is contained in:
parent
170ea477fb
commit
276200832a
@ -130,7 +130,7 @@ class CoreMiddleware extends HttpCoreMiddleware
|
||||
$ref = $definition['ref'];
|
||||
$class = ReflectionManager::reflectClass($ref);
|
||||
$parentClass = $class->getParentClass();
|
||||
if ($parentClass->getName() === ProtobufMessage::class) {
|
||||
if ($parentClass && $parentClass->getName() === ProtobufMessage::class) {
|
||||
$request = $this->request();
|
||||
$stream = $request->getBody();
|
||||
return Parser::deserializeMessage([$class->getName(), null], $stream->getContents());
|
||||
|
Loading…
Reference in New Issue
Block a user