summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/google-api-php-client/src/Google/Collection.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/3rdparty/google-api-php-client/src/Google/Collection.php')
-rw-r--r--apps/files_external/3rdparty/google-api-php-client/src/Google/Collection.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files_external/3rdparty/google-api-php-client/src/Google/Collection.php b/apps/files_external/3rdparty/google-api-php-client/src/Google/Collection.php
index 6e7bf9b0f1e..b26e9e51d0e 100644
--- a/apps/files_external/3rdparty/google-api-php-client/src/Google/Collection.php
+++ b/apps/files_external/3rdparty/google-api-php-client/src/Google/Collection.php
@@ -1,6 +1,8 @@
<?php
-require_once "Google/Model.php";
+if (!class_exists('Google_Client')) {
+ require_once dirname(__FILE__) . '/autoload.php';
+}
/**
* Extension to the regular Google_Model that automatically
@@ -48,10 +50,13 @@ class Google_Collection extends Google_Model implements Iterator, Countable
public function count()
{
+ if (!isset($this->modelData[$this->collection_key])) {
+ return 0;
+ }
return count($this->modelData[$this->collection_key]);
}
- public function offsetExists ($offset)
+ public function offsetExists($offset)
{
if (!is_numeric($offset)) {
return parent::offsetExists($offset);