diff options
-rw-r--r-- | lib/private/TemplateLayout.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 420fc414279..fe475ecf403 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -180,8 +180,12 @@ class TemplateLayout extends \OC_Template { } // Set body data-theme - $themesService = \OCP\Server::get(\OCA\Theming\Service\ThemesService::class); - $this->assign('enabledThemes', $themesService->getEnabledThemes()); + try { + $themesService = \OCP\Server::get(\OCA\Theming\Service\ThemesService::class); + } catch (\OCP\AppFramework\QueryException) { + $themesService = null; + } + $this->assign('enabledThemes', $themesService?->getEnabledThemes() ?? []); // Send the language, locale, and direction to our layouts $lang = \OC::$server->get(IFactory::class)->findLanguage(); |