Skip to content

Commit

Permalink
Add check whether $promiseOrValue is an object
Browse files Browse the repository at this point in the history
  • Loading branch information
s-bronstein committed Mar 3, 2020
1 parent 8d05ffd commit 43edd65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function resolve($promiseOrValue = null): PromiseInterface
return $promiseOrValue;
}

if (\method_exists($promiseOrValue, 'then')) {
if (\is_object($promiseOrValue) && \method_exists($promiseOrValue, 'then')) {
$canceller = null;

if (\method_exists($promiseOrValue, 'cancel')) {
Expand Down

0 comments on commit 43edd65

Please sign in to comment.