8000 Add check whether $promiseOrValue is an object · reactphp/promise@43edd65 · GitHub
[go: up one dir, main page]

Skip to content

Commit 43edd65

Browse files
authored
Add check whether $promiseOrValue is an object
1 parent 8d05ffd commit 43edd65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function resolve($promiseOrValue = null): PromiseInterface
2525
return $promiseOrValue;
2626
}
2727

28-
if (\method_exists($promiseOrValue, 'then')) {
28+
if (\is_object($promiseOrValue) && \method_exists($promiseOrValue, 'then')) {
2929
$canceller = null;
3030

3131
if (\method_exists($promiseOrValue, 'cancel')) {

0 commit comments

Comments
 (0)
0