From 75fec183561095ab5021f539458607897c7fb262 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 8 Apr 2022 00:23:45 +1200 Subject: [PATCH] Fix setting nested promise --- src/Appwrite/GraphQL/SwoolePromise.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/GraphQL/SwoolePromise.php b/src/Appwrite/GraphQL/SwoolePromise.php index f0329190eb..c817bb3c3e 100644 --- a/src/Appwrite/GraphQL/SwoolePromise.php +++ b/src/Appwrite/GraphQL/SwoolePromise.php @@ -181,8 +181,10 @@ class SwoolePromise private function setResult(mixed $value): void { if (!$value instanceof SwoolePromise) { - throw new \RuntimeException('Supported only Appwrite\GraphQL\SwoolePromise instance'); + $this->result = $value; + return; } + $resolved = false; $callable = function ($value) use (&$resolved) { $this->setResult($value); @@ -193,8 +195,6 @@ class SwoolePromise while (!$resolved) { usleep(25000); } - - $this->result = $value; } /**