Merge pull request #42847 from nextcloud/fix/42843/exception-on-their-own

exceptions on their own
pull/42923/head
Joas Schilling 2024-01-18 09:59:36 +07:00 committed by GitHub
commit 0e40457b86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 2 deletions

@ -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,