diff --git a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php
index 152c95ae60..dd1debb2b1 100644
--- a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php
+++ b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\statistics\Tests;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\node\Entity\Node;
 
 /**
  * Tests request logging for cached and uncached pages.
@@ -125,4 +126,12 @@ public function testLogging() {
     $this->assertIdentical($node_counter['totalcount'], '1');
+
+    // Try fetching statistics for an invalid node ID and verify it returns
+    // an empty array.
+    $node_id = 10000000000000000;
+    $node = Node::load($node_id);
+    $this->assertNull($node);
+    $result = statistics_get($node_id);
+    $this->assertIdentical($result, FALSE);
   }
 
 }
