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

AppConfig: returns default on exception
pull/42748/head
Joas Schilling 5 months ago committed by GitHub
commit c69be30db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save