@@ -150,6 +150,10 @@ private function getUrlGenerator(): IURLGenerator {
150150 * @return array<string,string> appId => enabled (may be 'yes', or a json encoded list of group ids)
151151 */
152152 private function getEnabledAppsValues (): array {
153+ if ($ this ->config ->getSystemValueBool ('installed ' , false ) === false ) {
154+ return [];
155+ }
156+
153157 if (!$ this ->enabledAppsCache ) {
154158 /** @var array<string,string> */
155159 $ values = $ this ->getAppConfig ()->searchValues ('enabled ' , false , IAppConfig::VALUE_STRING );
@@ -243,23 +247,16 @@ public function getEnabledAppsForGroup(IGroup $group): array {
243247 return array_keys ($ appsForGroups );
244248 }
245249
246- /**
247- * Loads all apps
248- *
249- * @param string[] $types
250- * @return bool
251- *
252- * This function walks through the Nextcloud directory and loads all apps
253- * it can find. A directory contains an app if the file /appinfo/info.xml
254- * exists.
255- *
256- * if $types is set to non-empty array, only apps of those types will be loaded
257- */
258250 #[\Override]
259251 public function loadApps (array $ types = []): bool {
260252 if ($ this ->config ->getSystemValueBool ('maintenance ' , false )) {
261253 return false ;
262254 }
255+ if ($ this ->config ->getSystemValueBool ('installed ' , false ) === false ) {
256+ // can only access the apps folder after installation, so we can't load any apps before that
257+ return false ;
258+ }
259+
263260 // Load the enabled apps here
264261 $ apps = $ this ->getEnabledApps ();
265262
0 commit comments