Skip checking WooCommerce support if stylesheet does not exist (https://github.com/woocommerce/woocommerce-admin/pull/5783)

This commit is contained in:
Moon 2020-12-02 15:38:07 -08:00 committed by GitHub
parent 9bdd0ab8db
commit 82ae70e910
1 changed files with 5 additions and 1 deletions

View File

@ -574,7 +574,11 @@ class Onboarding {
}
foreach ( $themes as $theme ) {
$directory = new \RecursiveDirectoryIterator( $theme->theme_root . '/' . $theme->stylesheet );
$stylesheet_file = $theme->theme_root . '/' . $theme->stylesheet;
if ( ! file_exists( $stylesheet_file ) ) {
continue;
}
$directory = new \RecursiveDirectoryIterator( $stylesheet_file );
$iterator = new \RecursiveIteratorIterator( $directory );
$files = new \RegexIterator( $iterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH );