diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index 0910eba73..6176f0742 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -436,8 +436,8 @@ class Extension implements Arrayable $links['support'] = "mailto:$supportEmail"; } - if (($funding = $this->composerJsonAttribute('funding')) && count($funding)) { - $links['donate'] = $funding[0]['url']; + if (($funding = $this->composerJsonAttribute('funding')) && is_array($funding) && ($fundingUrl = Arr::get($funding, '0.url'))) { + $links['donate'] = $fundingUrl; } $links['authors'] = [];