Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 13240)
+++ wp-includes/theme.php	(working copy)
@@ -598,8 +598,7 @@
 				}
 			}
 		}
-		if ( is_dir( $theme_dir ) )
-			@closedir( $theme_dir );
+		@closedir( $themes_dir );
 	}
 	return $theme_files;
 }
