Skip to content

Commit

Permalink
Speculative fix for BUGS-8929; guard against situations where Drupal\…
Browse files Browse the repository at this point in the history
…image\Entity\ImageStyle might not exist.
  • Loading branch information
greg-1-anderson committed Sep 27, 2024
1 parent 94d7892 commit c82c24d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pantheon_advanced_page_cache.module
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function pantheon_advanced_page_cache_file_update(EntityInterface $file) {

// If this is an image, we need to clear the edge cache paths for every
// image style, or those won't work.
if (strpos($file->getMimeType(), 'image', 0) === 0) {
if ((class_exists(ImageStyle)) && (strpos($file->getMimeType(), 'image', 0) === 0)) {
$styles = ImageStyle::loadMultiple();
foreach ($styles as $style) {
$file_uri = $file->getFileUri();
Expand Down

0 comments on commit c82c24d

Please sign in to comment.