Skip to content

Commit

Permalink
Prevent unsupported operand types exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestwisniewski authored Nov 22, 2022
1 parent d0ea95c commit 93dfecb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function extractJSON(string $json): array
try {
$data = json_decode($json, true);

return $data ? ($data + $this->defaults) : [];
return is_array($data) ? ($data + $this->defaults) : [];
} catch (Exception $exception) {
return [];
}
Expand Down

0 comments on commit 93dfecb

Please sign in to comment.