diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 4b87ba3baf..4d7f42a33c 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -10,6 +10,7 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; use Drupal\node\NodeInterface; +use Drupal\statistics\StatisticsViewsResult; /** * Implements hook_help(). @@ -128,7 +129,7 @@ function statistics_get($id) { // For backwards compatibility, return FALSE if an invalid node ID was // passed in. - if (empty($statistics)) { + if (!($statistics instanceof StatisticsViewsResult)) { return FALSE; } return [