From 3b8334e07353fce8ae69f765a9ce2aa4f6024df9 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 31 Jan 2020 20:33:18 +0100 Subject: [PATCH] Fully make use of yield from and async-friendly stack traces --- src/danog/MadelineProto/Coroutine.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/danog/MadelineProto/Coroutine.php b/src/danog/MadelineProto/Coroutine.php index ccbbb4fe..ca99eab0 100644 --- a/src/danog/MadelineProto/Coroutine.php +++ b/src/danog/MadelineProto/Coroutine.php @@ -87,9 +87,9 @@ final class Coroutine implements Promise, \ArrayAccess } else { $yielded = $this->generator->send($yielded); } - if ($yielded instanceof self) { - $yielded->parentCoroutine = $this; - } + } + if ($yielded instanceof self) { + $yielded->parentCoroutine = $this; } } catch (\Throwable $exception) { $this->fail($exception);