Skip to content

Commit

Permalink
Check if the cached js file exists
Browse files Browse the repository at this point in the history
Fixes nextcloud#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 <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Mar 7, 2018
1 parent 3867a74 commit 34b86ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/private/Template/JSCombiner.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,20 @@ public function process($root, $file, $app) {
* @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);
Expand Down

0 comments on commit 34b86ed

Please sign in to comment.