]> source.dussan.org Git - nextcloud-server.git/commitdiff
exceptions on their own 42847/head
authorMaxence Lange <maxence@artificial-owl.com>
Tue, 16 Jan 2024 13:48:27 +0000 (12:48 -0100)
committerMaxence Lange <maxence@artificial-owl.com>
Tue, 16 Jan 2024 13:48:27 +0000 (12:48 -0100)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
lib/private/AppConfig.php

index e8192530c179954687c1589445c4eca12f67517a..a6c92351a972f50461add0698820fe9ac8631dd8 100644 (file)
@@ -164,7 +164,11 @@ class AppConfig implements IAppConfig {
                $this->assertParams($app, $key);
                $this->loadConfig($lazy);
 
-               return $this->isTyped(self::VALUE_SENSITIVE, $this->valueTypes[$app][$key] ?? throw new AppConfigUnknownKeyException('unknown config key'));
+               if (!isset($this->valueTypes[$app][$key])) {
+                       throw new AppConfigUnknownKeyException('unknown config key');
+               }
+
+               return $this->isTyped(self::VALUE_SENSITIVE, $this->valueTypes[$app][$key]);
        }
 
        /**
@@ -955,10 +959,14 @@ class AppConfig implements IAppConfig {
                        $typeString = (string)$type;
                }
 
+               if (!isset($cache[$app][$key])) {
+                       throw new AppConfigUnknownKeyException('unknown config key');
+               }
+
                return [
                        'app' => $app,
                        'key' => $key,
-                       'value' => $cache[$app][$key] ?? throw new AppConfigUnknownKeyException('unknown config key'),
+                       'value' => $cache[$app][$key],
                        'type' => $type,
                        'lazy' => $lazy,
                        'typeString' => $typeString,