diff --git a/core/modules/system/src/Form/ModulesUninstallForm.php b/core/modules/system/src/Form/ModulesUninstallForm.php
index f72fa43..d0e233b 100644
--- a/core/modules/system/src/Form/ModulesUninstallForm.php
+++ b/core/modules/system/src/Form/ModulesUninstallForm.php
@@ -171,7 +171,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
   public function validateForm(array &$form, FormStateInterface $form_state) {
     // Form submitted, but no modules selected.
     if (!array_filter($form_state->getValue('uninstall'))) {
-      $form_state->setErrorByName('uninstall', $this->t('No modules selected.'));
+      $form_state->setErrorByName('', $this->t('No modules selected.'));
       $form_state->setRedirect('system.modules_uninstall');
     }
   }
diff --git a/core/modules/system/src/Tests/Module/UninstallTest.php b/core/modules/system/src/Tests/Module/UninstallTest.php
index aa8a169..2c7dd97 100644
--- a/core/modules/system/src/Tests/Module/UninstallTest.php
+++ b/core/modules/system/src/Tests/Module/UninstallTest.php
@@ -117,4 +117,17 @@ function testUninstallPage() {
     $this->assertUrl('admin/modules/uninstall');
     $this->assertTitle(t('Uninstall') . ' | Drupal');
   }
+
+  /**
+   * Test the uninstall module page form without selecting any module to uninstall.
+   */
+  function testUninstallModulesPage() {
+    $account = $this->drupalCreateUser(array('administer modules'));
+    $this->drupalLogin($account);
+    $this->drupalGet('admin/modules/uninstall');
+    $this->assertTitle(t('Uninstall') . ' | Drupal');
+    $edit = array();
+    $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall'));
+    $this->assertText(t('No modules selected. '), 'No module is selected to uninstall');
+  }
 }
