Skip to content

Commit

Permalink
Fix incorrect array access
Browse files Browse the repository at this point in the history
  • Loading branch information
gfaudriga committed Mar 26, 2024
1 parent b3e651b commit 1b68d0b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Service/SchemaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions tests/Unit/Service/SchemaServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b68d0b

Please sign in to comment.