Skip to content
Snippets Groups Projects
Commit d0144731 authored by catch's avatar catch
Browse files

Issue #3278883 by vhin0210, longwave: TypeError: Argument 1 passed to...

Issue #3278883 by vhin0210, longwave: TypeError: Argument 1 passed to Drupal\Core\Entity\EntityViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in core/modules/node/node.module on line 559

(cherry picked from commit dd664245)
parent 151161ee
No related branches found
No related tags found
No related merge requests found
......@@ -586,9 +586,11 @@ function template_preprocess_node(&$variables) {
// 'compact' view mode on the User entity. Note that the 'compact'
// view mode might not be configured, so remember to always check the
// theme setting first.
$variables['author_picture'] = \Drupal::entityTypeManager()
->getViewBuilder('user')
->view($node->getOwner(), 'compact');
if ($node_owner = $node->getOwner()) {
$variables['author_picture'] = \Drupal::entityTypeManager()
->getViewBuilder('user')
->view($node_owner, 'compact');
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment