aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppConfig.php
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-01-18 09:59:36 +0100
committerGitHub <noreply@github.com>2024-01-18 09:59:36 +0100
commit0e40457b86ae8ba0937a9e335e12d9b04eba1bb4 (patch)
treed207721ea47d824958048dfeaf1c93967d49ee65 /lib/private/AppConfig.php
parenta9ba1fe7e1bec82bd6c940743c7bacb6af4212ef (diff)
parentdb8636ac1a7b208d681465421c8d433a3254c6f3 (diff)
downloadnextcloud-server-0e40457b86ae8ba0937a9e335e12d9b04eba1bb4.tar.gz
nextcloud-server-0e40457b86ae8ba0937a9e335e12d9b04eba1bb4.zip
Merge pull request #42847 from nextcloud/fix/42843/exception-on-their-own
exceptions on their own
Diffstat (limited to 'lib/private/AppConfig.php')
-rw-r--r--lib/private/AppConfig.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index 505d5c52696..d15aff37c5b 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -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]);
}
/**
@@ -961,10 +965,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,