mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Merge pull request #42844 from nextcloud/fix/noid/default-on-unknown-config-key
AppConfig: returns default on exception
This commit is contained in:
commit
c69be30db4
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue