diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
index 83aea6fee91c5611b37c28d72498009d8225f449..b9f326772d29b19e2fe8a51088de76ffb72ab4aa 100644
--- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
+++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
@@ -255,7 +255,9 @@ public function flush($path = NULL) {
     // Delete the style directory in each registered wrapper.
     $wrappers = file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE);
     foreach ($wrappers as $wrapper => $wrapper_data) {
-      file_unmanaged_delete_recursive($wrapper . '://styles/' . $this->id());
+      if (file_exists($directory = $wrapper . '://styles/' . $this->id())) {
+        file_unmanaged_delete_recursive($directory);
+      }
     }
 
     // Let other modules update as necessary on flush.