Skip to content

Commit

Permalink
Fix Countable error on php 8.1 in laravel 9
Browse files Browse the repository at this point in the history
Error message:
`count(): Argument masbug#1 ($value) must be of type Countable|array, null given`
  • Loading branch information
coendr authored Jan 9, 2023
1 parent 3947d39 commit c64213e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GoogleDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ private function getRawVisibility($file)
$permissions = $file->getPermissions();
$visibility = Visibility::PRIVATE;

if (! count($permissions)) {
if (is_null($permissions) || ! count($permissions)) {
$permissions = $this->service->permissions->listPermissions($file->getId(), $this->applyDefaultParams([], 'permissions.list'));
$file->setPermissions($permissions);
}
Expand Down

1 comment on commit c64213e

@robindirksen1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See masbug#92

Please sign in to comment.