From 34b86edc349540439277b3f9cd69fd271980c4de Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 7 Mar 2018 12:55:05 +0100 Subject: [PATCH] Check if the cached js file exists Fixes #8705 If the file does not exist (for whatever reason). It is never cached. No matter what the depscache etc tell you. Signed-off-by: Roeland Jago Douma --- lib/private/Template/JSCombiner.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php index c5adcee685..bc548c22fd 100644 --- a/lib/private/Template/JSCombiner.php +++ b/lib/private/Template/JSCombiner.php @@ -104,13 +104,20 @@ class JSCombiner { * @return bool */ protected function isCached($fileName, ISimpleFolder $folder) { - $fileName = str_replace('.json', '.js', $fileName) . '.deps'; + $fileName = str_replace('.json', '.js', $fileName); + + if (!$folder->fileExists($fileName)) { + return false; + } + + $fileName = $fileName . '.deps'; try { $deps = $this->depsCache->get($folder->getName() . '-' . $fileName); if ($deps === null || $deps === '') { $depFile = $folder->getFile($fileName); $deps = $depFile->getContent(); } + // check again if ($deps === null || $deps === '') { $this->logger->info('JSCombiner: deps file empty: ' . $fileName);