diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc
index 5e31876..1a43fae 100644
--- a/core/modules/comment/comment.views.inc
+++ b/core/modules/comment/comment.views.inc
@@ -9,16 +9,18 @@
  * Implements hook_views_data_alter().
  */
 function comment_views_data_alter(&$data) {
-  // New comments are only supported for node table because it requires the
-  // history table.
-  $data['node']['new_comments'] = array(
-    'title' => t('New comments'),
-    'help' => t('The number of new comments on the node.'),
-    'field' => array(
-      'id' => 'node_new_comments',
-      'no group by' => TRUE,
-    ),
-  );
+  if (\Drupal::moduleHandler()->moduleExists('history')) {
+    // New comments are only supported for node table because it requires the
+    // history table.
+    $data['node']['new_comments'] = array(
+      'title' => t('New comments'),
+      'help' => t('The number of new comments on the node.'),
+      'field' => array(
+        'id' => 'node_new_comments',
+        'no group by' => TRUE,
+      ),
+    );
+  }
 
   // Provide a integration for each entity type except comment.
   foreach (\Drupal::entityManager()->getDefinitions() as $entity_type_id => $entity_type) {
diff --git a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
index 5a9f5b3..362203a 100644
--- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
+++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
@@ -201,4 +201,13 @@ public function render(ResultRow $values) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function calculateDependencies() {
+    $dependencies = parent::calculateDependencies();
+    $dependencies['module'][] = 'history';
+    return $dependencies;
+  }
+
 }
diff --git a/core/modules/comment/src/Tests/Views/NodeCommentsTest.php b/core/modules/comment/src/Tests/Views/NodeCommentsTest.php
index b0ee315..3ed3a1c 100644
--- a/core/modules/comment/src/Tests/Views/NodeCommentsTest.php
+++ b/core/modules/comment/src/Tests/Views/NodeCommentsTest.php
@@ -31,6 +31,14 @@ public function testNewComments() {
     $this->assertResponse(200);
     $new_comments = $this->cssSelect(".views-field-new-comments a:contains('1')");
     $this->assertEqual(count($new_comments), 1, 'Found the number of new comments for a certain node.');
+
+    // Test that view displayed when history module disabled.
+    /** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer **/
+    $module_installer = \Drupal::service('module_installer');
+    $module_installer->uninstall(['history']);
+    $this->rebuildAll();
+    $this->drupalGet('test-new-comments');
+    $this->assertResponse(404);
   }
 
 }
diff --git a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml
index e329976..f562974 100644
--- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml
+++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml
@@ -3,6 +3,7 @@ status: true
 dependencies:
   module:
     - comment
+    - history
     - node
     - user
 id: '2505879'
