- Issue created by @aldibier
Sometimes when AddToAny share buttons field is used in Views, the render method fails with the following message
Uncaught PHP Exception Error: "Call to a member function access() on null" at web/modules/contrib/addtoany/src/Plugin/views/field/NodeAddToAnyShare.php line 29
It's happened when values to render aren't entity node objects.
Add a validation before rendering in the same if of check access.
if ($entity->access('view')) {
New Validation:
if ($entity instanceof \Drupal\Core\Entity\EntityInterface && $entity->access('view')) {
Active
2.0
Code