浏览代码

Fix notice

Jordi Boggiano 13 年之前
父节点
当前提交
126c57d07c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Repository/Vcs/GitBitbucketDriver.php

+ 1 - 1
src/Composer/Repository/Vcs/GitBitbucketDriver.php

@@ -49,7 +49,7 @@ class GitBitbucketDriver implements VcsDriverInterface
     {
     {
         if (null === $this->rootIdentifier) {
         if (null === $this->rootIdentifier) {
             $repoData = json_decode(file_get_contents('https://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository), true);
             $repoData = json_decode(file_get_contents('https://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository), true);
-            $this->rootIdentifier = $repoData['main_branch'] ?: 'master';
+            $this->rootIdentifier = !empty($repoData['main_branch']) ? $repoData['main_branch'] : 'master';
         }
         }
 
 
         return $this->rootIdentifier;
         return $this->rootIdentifier;