From 95e9ad57d429567a1b34a6ab3c7bcbff9de335ee Mon Sep 17 00:00:00 2001 From: Pete Akins Date: Wed, 4 Jan 2017 21:29:38 -0500 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20add=20github=20specials=20if=20?= =?UTF-8?q?there=20is=20no=20composer=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This can happen if an identifier doesn’t have a composer.json file (but other identifiers do) --- src/Composer/Repository/Vcs/GitHubDriver.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Composer/Repository/Vcs/GitHubDriver.php b/src/Composer/Repository/Vcs/GitHubDriver.php index b33b99916..ed4155c01 100644 --- a/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/src/Composer/Repository/Vcs/GitHubDriver.php @@ -152,14 +152,16 @@ class GitHubDriver extends VcsDriver } $composer = $this->getBaseComposerInformation($identifier); + if ($composer) { - // specials for github - if (!isset($composer['support']['source'])) { - $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier; - $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label); - } - if (!isset($composer['support']['issues']) && $this->hasIssues) { - $composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository); + // specials for github + if (!isset($composer['support']['source'])) { + $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier; + $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label); + } + if (!isset($composer['support']['issues']) && $this->hasIssues) { + $composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository); + } } if ($this->shouldCache($identifier)) {