From 76f5b99c52d0fadca5adff4800f53984ccf940c5 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 8 Sep 2016 09:09:15 -0600 Subject: [PATCH] Quietly skip missing streams on clear --- system/src/Grav/Common/Cache.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/src/Grav/Common/Cache.php b/system/src/Grav/Common/Cache.php index 49329448c..099436dad 100644 --- a/system/src/Grav/Common/Cache.php +++ b/system/src/Grav/Common/Cache.php @@ -325,10 +325,11 @@ class Cache extends Getters foreach ($remove_paths as $stream) { // Convert stream to a real path - $path = $locator->findResource($stream, true, true); - // Make sure path exists before proceeding, otherwise we would wipe ROOT_DIR - if (!$path) { - throw new \RuntimeException("Stream '{$stream}' not found", 500); + try { + $path = $locator->findResource($stream, true, true); + } catch (\Exception $e) { + // stream not found.. + continue; } $anything = false;