From d81cdcbe883b334ae08f14d4a411bfd037da9f24 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Sat, 25 Mar 2017 15:25:06 +0100 Subject: Don't run JSCombiner when not installed When the instance is not installed don't run the JSCombiner as the appdata folder does not yet exist. Signed-off-by: Lukas Reschke --- lib/private/Template/JSCombiner.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php index a7bbf129e01..9f92813f905 100644 --- a/lib/private/Template/JSCombiner.php +++ b/lib/private/Template/JSCombiner.php @@ -45,11 +45,10 @@ class JSCombiner { protected $config; /** - * JSCombiner constructor. - * * @param IAppData $appData * @param IURLGenerator $urlGenerator * @param ICache $depsCache + * @param SystemConfig $config */ public function __construct(IAppData $appData, IURLGenerator $urlGenerator, @@ -68,7 +67,7 @@ class JSCombiner { * @return bool */ public function process($root, $file, $app) { - if ($this->config->getValue('debug')) { + if ($this->config->getValue('debug') || !$this->config->getValue('installed')) { return false; } @@ -183,7 +182,11 @@ class JSCombiner { * @return string[] */ public function getContent($root, $file) { + /** @var array $data */ $data = json_decode(file_get_contents($root . '/' . $file)); + if(!is_array($data)) { + return []; + } $path = explode('/', $file); array_pop($path); -- cgit v1.2.3