Skip to content

Commit

Permalink
Add check for css file before trying to read (#12291)
Browse files Browse the repository at this point in the history
* Add check for css file before trying to read

Mirrors existing trac ticket https://core.trac.wordpress.org/ticket/45288

Fixes #12196

* Use other patch :-)
  • Loading branch information
mkaz authored and youknowriad committed Nov 29, 2018
1 parent 747effd commit 455ef19
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -1224,11 +1224,13 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'css' => file_get_contents( $style ),
);
} else {
$file = get_theme_file_path( $style );
$styles[] = array(
'css' => file_get_contents( get_theme_file_path( $style ) ),
'baseURL' => get_theme_file_uri( $style ),
);
$file = get_theme_file_path( $style );
if ( file_exists( $file ) ) {
$styles[] = array(
'css' => file_get_contents( $file ),
'baseURL' => get_theme_file_uri( $style ),
);
}
}
}
}
Expand Down

0 comments on commit 455ef19

Please sign in to comment.