diff --git a/includes/update.inc b/includes/update.inc
index f89fea9babb2df857fe76270d519fa2480dac462..6b700700c1bbd7de5bc45ebefb4f9adf1f8f2864 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -977,10 +977,13 @@ function update_get_update_list() {
 
   $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);
   foreach ($modules as $module => $schema_version) {
-    $pending = array();
+    // Skip uninstalled and incompatible modules.
+    if ($schema_version == SCHEMA_UNINSTALLED || update_check_incompatibility($module)) {
+      continue;
+    }
+    // Otherwise, get the list of updates defined by this module.
     $updates = drupal_get_schema_versions($module);
-    // Skip incompatible module updates, otherwise test schema versions.
-    if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) {
+    if ($updates !== FALSE) {
       // module_invoke returns NULL for nonexisting hooks, so if no updates
       // are removed, it will == 0.
       $last_removed = module_invoke($module, 'update_last_removed');