diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php
index c2a0bcd..549cb9f 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php
+++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php
@@ -12,6 +12,7 @@
 use Drupal\taxonomy\Entity\Vocabulary;
 use Drupal\views\Tests\ViewTestData;
 use Drupal\views_ui\Tests\UITestBase;
+use Drupal\views\Views;
 
 /**
  * Tests the taxonomy index filter handler UI.
@@ -28,14 +29,14 @@ class TaxonomyIndexTidUiTest extends UITestBase {
    *
    * @var array
    */
-  public static $testViews = array('test_filter_taxonomy_index_tid');
+  public static $testViews = array('test_filter_taxonomy_index_tid', 'test_taxonomy_term_name');
 
   /**
    * Modules to enable.
    *
    * @var array
    */
-  public static $modules = ['node', 'taxonomy', 'taxonomy_test_views'];
+  public static $modules = ['node', 'taxonomy', 'views', 'views_ui', 'taxonomy_test_views', 'dblog'];
 
   /**
    * A nested array of \Drupal\taxonomy\TermInterface objects.
@@ -50,6 +51,9 @@ class TaxonomyIndexTidUiTest extends UITestBase {
   protected function setUp() {
     parent::setUp();
 
+    $this->adminUser = $this->drupalCreateUser(['administer taxonomy', 'administer views', 'access site reports']);
+    $this->drupalLogin($this->adminUser);
+
     Vocabulary::create([
       'vid' => 'tags',
       'name' => 'Tags',
@@ -73,6 +77,11 @@ protected function setUp() {
       }
     }
     ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views'));
+
+    Vocabulary::create([
+      'vid' => 'empty_vocabulary',
+      'name' => 'Empty Vocabulary',
+    ])->save();
   }
 
   /**
@@ -191,4 +200,19 @@ public function testExposedFilter() {
     $this->assertIdentical(1, count($xpath));
   }
 
+  public function testEmptyTaxonomyIndexTid() {
+    $view = Views::getView('test_taxonomy_term_name');
+    $edit['name[taxonomy_term_field_data.tid]'] = TRUE;
+    $this->drupalPostForm('admin/structure/views/nojs/add-handler/test_taxonomy_term_name/default/filter', $edit, 'Add and configure filter criteria');
+    $this->drupalPostForm('admin/structure/views/nojs/handler-extra/test_taxonomy_term_name/default/filter/tid', [], 'Apply');
+    $edit_1['options[expose_button][checkbox][checkbox]'] = TRUE;
+    $this->drupalPostForm('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid', $edit_1, 'Expose filter');
+    $this->drupalPostForm('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid', $edit_1, 'Apply');
+    $this->drupalPostForm('admin/structure/views/view/test_taxonomy_term_name/edit/default', [], 'Save');
+    $this->drupalPostForm(NULL, [], t('Update preview'));
+    $this->drupalGet('/admin/reports/dblog');
+    $result = $this->xpath('//a[contains(@title, :title)]', [':title' => 'Warning: Invalid argument supplied for foreach() in Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid->validateExposed()']);
+    $this->assertNotEqual(count($result), 1, "Warning message is not displayed");
+  }
+
 }
