From 81dc9126a95a9ff230d833295c0d22ef0d9354a9 Mon Sep 17 00:00:00 2001 From: Brad Jones Date: Thu, 27 Sep 2018 16:41:46 -0600 Subject: [PATCH] Catch NotFoundException on delete allUsers ACL, ignore. --- src/GoogleStorageAdapter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/GoogleStorageAdapter.php b/src/GoogleStorageAdapter.php index faff062..f79717c 100644 --- a/src/GoogleStorageAdapter.php +++ b/src/GoogleStorageAdapter.php @@ -280,7 +280,12 @@ public function setVisibility($path, $visibility) $object = $this->getObject($path); if ($visibility === AdapterInterface::VISIBILITY_PRIVATE) { + try { $object->acl()->delete('allUsers'); + } + catch (NotFoundException $e) { + // Not actually an exception, no ACL to delete. + } } elseif ($visibility === AdapterInterface::VISIBILITY_PUBLIC) { $object->acl()->add('allUsers', Acl::ROLE_READER); }