Skip to content

Commit

Permalink
Merge pull request #21 from Superbalist/fix-google-client-returning-f…
Browse files Browse the repository at this point in the history
…alse-on-empty-file

fix google client returning false on empty file
  • Loading branch information
matthewgoslett committed Apr 12, 2016
2 parents dee91c6 + b64671d commit 441a852
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Changelog

## 1.0.0 - 2015-10-16
## 1.0.2 - 2016-04-12

* Initial release
* Fix to now return null instead of false when a file is empty (@paulcanning)

## 1.0.1 - 2016-03-29

* Change composer.json to support both v1.1 and 2.0.0RC of google/apiclient (@cedricziel)
* Fix to handling of private / public permissions (@cedricziel)

## 1.0.0 - 2015-10-16

* Initial release
6 changes: 5 additions & 1 deletion src/GoogleStorageAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ public function read($path)
// TODO: can this be optimised to not perform 2 x api calls here?
$object = $this->getObject($path);
$object = $this->normaliseObject($object);
$object['contents'] = $this->service->objects->get($this->bucket, $path, ['alt' => 'media']);
$contents = $this->service->objects->get($this->bucket, $path, ['alt' => 'media']);
if ($contents === false) {
$contents = null;
}
$object['contents'] = $contents;
return $object;
}

Expand Down

0 comments on commit 441a852

Please sign in to comment.