Browse Source

Fix issue when updating github data and count is 0

Jordi Boggiano 9 years ago
parent
commit
b48272af9a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/Packagist/WebBundle/Package/Updater.php

+ 4 - 4
src/Packagist/WebBundle/Package/Updater.php

@@ -479,16 +479,16 @@ class Updater
         if (!empty($repoData['language'])) {
             $package->setLanguage($repoData['language']);
         }
-        if (!empty($repoData['stargazers_count'])) {
+        if (isset($repoData['stargazers_count'])) {
             $package->setGitHubStars($repoData['stargazers_count']);
         }
-        if (!empty($repoData['subscribers_count'])) {
+        if (isset($repoData['subscribers_count'])) {
             $package->setGitHubWatches($repoData['subscribers_count']);
         }
-        if (!empty($repoData['network_count'])) {
+        if (isset($repoData['network_count'])) {
             $package->setGitHubForks($repoData['network_count']);
         }
-        if (!empty($repoData['open_issues_count'])) {
+        if (isset($repoData['open_issues_count'])) {
             $package->setGitHubOpenIssues($repoData['open_issues_count']);
         }
     }