Skip to content

Commit

Permalink
Check if there is a user before checking if they can create entries
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Oct 21, 2024
1 parent 3a7d6fc commit b7c8f06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fieldtypes/Entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ protected function getCreatables()

throw_if(! $collection, new CollectionNotFoundException($collectionHandle));

if (! $user->can('create', [EntryContract::class, $collection])) {
if (! $user || ! $user->can('create', [EntryContract::class, $collection])) {
return null;
}

Expand Down

0 comments on commit b7c8f06

Please sign in to comment.