]> source.dussan.org Git - nextcloud-server.git/commitdiff
returns default on exception 42844/head
authorMaxence Lange <maxence@artificial-owl.com>
Tue, 16 Jan 2024 13:35:05 +0000 (12:35 -0100)
committerMaxence Lange <maxence@artificial-owl.com>
Tue, 16 Jan 2024 13:35:24 +0000 (12:35 -0100)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
lib/private/AppConfig.php

index e8192530c179954687c1589445c4eca12f67517a..505d5c52696c525d5f1260afd1018fe0c2868c9d 100644 (file)
@@ -292,11 +292,17 @@ class AppConfig implements IAppConfig {
                string $default = '',
                ?bool $lazy = false
        ): string {
+               try {
+                       $lazy = ($lazy === null) ? $this->isLazy($app, $key) : $lazy;
+               } catch (AppConfigUnknownKeyException $e) {
+                       return $default;
+               }
+
                return $this->getTypedValue(
                        $app,
                        $key,
                        $default,
-                       ($lazy === null) ? $this->isLazy($app, $key) : $lazy,
+                       $lazy,
                        self::VALUE_MIXED
                );
        }