Skip to content
Snippets Groups Projects
Commit 786ef8bc authored by Daniel Korte's avatar Daniel Korte Committed by Jonathan Sacksick
Browse files

Issue #3116907 by Daniel Korte: Deleted users cause profile collection error.

parent acedd509
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,10 @@ class ProfileAccessControlHandler extends UncacheableEntityAccessControlHandler ...@@ -41,7 +41,10 @@ class ProfileAccessControlHandler extends UncacheableEntityAccessControlHandler
$result = parent::checkAccess($entity, $operation, $account); $result = parent::checkAccess($entity, $operation, $account);
if ($result->isAllowed()) { if ($result->isAllowed()) {
/** @var \Drupal\profile\Entity\ProfileInterface $entity */ /** @var \Drupal\profile\Entity\ProfileInterface $entity */
$result = $result->andIf($this->checkRoleAccess($entity->getOwner(), $entity->bundle())); $owner = $entity->getOwner();
if ($owner) {
$result = $result->andIf($this->checkRoleAccess($owner, $entity->bundle()));
}
} }
return $result; return $result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment