Merge pull request #8557 from nextcloud/fix-theming-defaults

Fix check if theming defaults instance is available
This commit is contained in:
Roeland Jago Douma 2018-02-27 10:49:02 +01:00 committed by GitHub
commit d0a6368a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -35,6 +35,7 @@ declare(strict_types=1);
namespace OC;
use OCA\Theming\ThemingDefaults;
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IRequest;
@ -168,7 +169,10 @@ class URLGenerator implements IURLGenerator {
$themingEnabled = $this->config->getSystemValue('installed', false) && \OCP\App::isEnabled('theming') && \OC_App::isAppLoaded('theming');
$themingImagePath = false;
if($themingEnabled) {
$themingImagePath = \OC::$server->getThemingDefaults()->replaceImagePath($app, $image);
$themingDefaults = \OC::$server->getThemingDefaults();
if ($themingDefaults instanceof ThemingDefaults) {
$themingImagePath = $themingDefaults->replaceImagePath($app, $image);
}
}
if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) {