Skip to content

Commit 8feffb8

Browse files
s-bronsteinjsor
authored andcommitted
Add check whether $cancellable is an object
1 parent f0430ac commit 8feffb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CancellationQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __invoke()
1919

2020
public function enqueue($cancellable)
2121
{
22-
if (!\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) {
22+
if (!\is_object($cancellable) || !\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) {
2323
return;
2424
}
2525

0 commit comments

Comments
 (0)