Skip to content

Commit

Permalink
Merge pull request #507 from ernestwisniewski/master
Browse files Browse the repository at this point in the history
Prevent unsupported operand types exception
  • Loading branch information
oscarotero authored Nov 23, 2022
2 parents d0ea95c + 93dfecb commit ae48f65
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 ae48f65

Please sign in to comment.