Skip to content

Commit 6c92c87

Browse files
committed
Fix to required parameter missed
1 parent a9beda6 commit 6c92c87

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

src/Kernel/Mnemonics/_invokevirtual.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,19 @@ public function execute(): void
5151
$reflectionClass = new \ReflectionClass($invokerClass);
5252
$methodAccessor = $reflectionClass->getMethod($methodName);
5353

54-
// parse PHPDoc
55-
$documentBlock = \phpDocumentor\Reflection\DocBlockFactory::createInstance()
56-
->create($methodAccessor->getDocComment());
54+
if ($document = $methodAccessor->getDocComment()) {
55+
// parse PHPDoc
56+
$documentBlock = \phpDocumentor\Reflection\DocBlockFactory::createInstance()
57+
->create($document);
5758

58-
// Native annotation will dependency inject.
59-
if (!empty($documentBlock->getTagsByName('native'))) {
60-
array_unshift(
61-
$arguments,
62-
$this->getConstantPool(),
63-
$this->javaClass
64-
);
59+
// Native annotation will dependency inject.
60+
if (!empty($documentBlock->getTagsByName('native'))) {
61+
array_unshift(
62+
$arguments,
63+
$this->getConstantPool(),
64+
$this->javaClass
65+
);
66+
}
6567
}
6668

6769
$result = $methodAccessor->invokeArgs(

0 commit comments

Comments
 (0)