diff --git a/src/Composer/Repository/Vcs/GitHubDriver.php b/src/Composer/Repository/Vcs/GitHubDriver.php index 4a4e1fcea..009f1ce0b 100644 --- a/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/src/Composer/Repository/Vcs/GitHubDriver.php @@ -188,7 +188,7 @@ class GitHubDriver extends VcsDriver } } - if (preg_match('{[a-f0-9]{40}}i', $identifier)) { + if ($composer && preg_match('{[a-f0-9]{40}}i', $identifier)) { $this->cache->write($identifier, json_encode($composer)); }