diff --git a/lib/Service/SchemaService.php b/lib/Service/SchemaService.php index f9aa57a3c0..127352a73b 100644 --- a/lib/Service/SchemaService.php +++ b/lib/Service/SchemaService.php @@ -117,7 +117,7 @@ public function extract(Account $account, Mailbox $mailbox, int $id) { // TODO: Add future dependencies here. ]; - $schemaType = $schema->{"@type"}; + $schemaType = is_array($result) ? $result[0]->{"@type"} : $result->{"@type"}; if (!array_key_exists($schemaType, $requiredAppForTypeMap)) { return $result; diff --git a/tests/Unit/Service/SchemaServiceTest.php b/tests/Unit/Service/SchemaServiceTest.php index 2318eac849..e6a1321c68 100644 --- a/tests/Unit/Service/SchemaServiceTest.php +++ b/tests/Unit/Service/SchemaServiceTest.php @@ -40,8 +40,6 @@ use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\NullLogger; -use function Amp\Iterator\toArray; - class SchemaServiceTest extends TestCase { /** @var IMAPClientFactory|MockObject */ private $imapClientFactory;