Commit eaa910de 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 5073245c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -554,9 +554,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.
        if ($node_owner = $node->getOwner()) {
          $variables['author_picture'] = \Drupal::entityTypeManager()
            ->getViewBuilder('user')
          ->view($node->getOwner(), 'compact');
            ->view($node_owner, 'compact');
        }
      }
    }
  }