diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-03 08:03:39 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-03 08:03:39 +0400 |
commit | bd6fcdef1fd7fe7c772b735a3526d64d100f4574 (patch) | |
tree | 9d1a85324c76a5bd69796f708cf57169bf2837de /core | |
parent | 5cbbb4f47b69e977aa43b4403fb3459187f0111b (diff) | |
parent | 0dc5f51d9832dc34f0ccbe559635cd0e2a39f919 (diff) |
Merge branch 'master' of github.com:piwik/piwik
Diffstat (limited to 'core')
-rw-r--r-- | core/CronArchive.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index 0f3e877de5..015298f37c 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -1122,12 +1122,18 @@ class CronArchive private function getVisitsLastPeriodFromApiResponse($stats) { + if(empty($stats)) { + return 0; + } $today = end($stats); return $today['nb_visits']; } private function getVisitsFromApiResponse($stats) { + if(empty($stats)) { + return 0; + } $visits = 0; foreach($stats as $metrics) { if(empty($metrics['nb_visits'])) { @@ -1200,7 +1206,7 @@ class CronArchiveFatalException extends Exception $this->fullOutput = $fullOutput; } - public function logAndExit($cronArchiver) + public function logAndExit(CronArchive $cronArchiver) { if ($cronArchiver->isCoreInited()) { $cronArchiver->logError($this->getMessage()); |