diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-07-19 16:31:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 16:31:29 +0200 |
commit | 49c622fcbafe039c44d95595edfdda8a0cf7e042 (patch) | |
tree | 1848096a37227f92b222faa5ff1428c287549002 /lib | |
parent | d5e3428af54bd85a6008a74dc8a3a9c09204179a (diff) | |
parent | 2ebafb06fdef6aad4bc32316ece14faa60f9e9c4 (diff) | |
download | nextcloud-server-49c622fcbafe039c44d95595edfdda8a0cf7e042.tar.gz nextcloud-server-49c622fcbafe039c44d95595edfdda8a0cf7e042.zip |
Merge pull request #5719 from nextcloud/improve-jscombiner
Properly handle if the deps file if for some reason empty
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Template/JSCombiner.php | 15 | ||||
-rw-r--r-- | lib/private/TemplateLayout.php | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php index 8254174bfc0..8a9e7e747e0 100644 --- a/lib/private/Template/JSCombiner.php +++ b/lib/private/Template/JSCombiner.php @@ -28,6 +28,7 @@ use OCP\Files\IAppData; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\Files\SimpleFS\ISimpleFolder; +use OCP\ILogger; use OCP\IURLGenerator; class JSCombiner { @@ -44,20 +45,26 @@ class JSCombiner { /** @var SystemConfig */ protected $config; + /** @var ILogger */ + protected $logger; + /** * @param IAppData $appData * @param IURLGenerator $urlGenerator * @param ICache $depsCache * @param SystemConfig $config + * @param ILogger $logger */ public function __construct(IAppData $appData, IURLGenerator $urlGenerator, ICache $depsCache, - SystemConfig $config) { + SystemConfig $config, + ILogger $logger) { $this->appData = $appData; $this->urlGenerator = $urlGenerator; $this->depsCache = $depsCache; $this->config = $config; + $this->logger = $logger; } /** @@ -102,6 +109,12 @@ class JSCombiner { $depFile = $folder->getFile($fileName); $deps = $depFile->getContent(); } + // check again + if ($deps === null || $deps === '') { + $this->logger->info('JSCombiner: deps file empty: ' . $fileName); + return false; + } + $deps = json_decode($deps, true); foreach ($deps as $file=>$mtime) { diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index f7bb23cd3de..9e9ec709cf5 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -243,7 +243,8 @@ class TemplateLayout extends \OC_Template { \OC::$server->getAppDataDir('js'), \OC::$server->getURLGenerator(), \OC::$server->getMemCacheFactory()->create('JS'), - \OC::$server->getSystemConfig() + \OC::$server->getSystemConfig(), + \OC::$server->getLogger() ) ); $locator->find($scripts); |