diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 6cef26f8b..e6a6f2859 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -175,7 +175,8 @@ function get_themes() { } } } - @closedir($theme_dir); + if ( is_dir( $theme_dir ) ) + @closedir( $theme_dir ); if ( !$themes_dir || !$theme_files ) return $themes;