Merge pull request #42844 from nextcloud/fix/noid/default-on-unknown-config-key

AppConfig: returns default on exception
This commit is contained in:
Joas Schilling 2024-01-16 16:21:57 +01:00 committed by GitHub
commit c69be30db4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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
);
}