Skip to content

Commit

Permalink
Merge pull request #42844 from nextcloud/fix/noid/default-on-unknown-…
Browse files Browse the repository at this point in the history
…config-key

AppConfig: returns default on exception
  • Loading branch information
nickvergessen authored Jan 16, 2024
2 parents 41fa99a + addd678 commit c69be30
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/private/AppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,17 @@ public function getValueMixed(
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
);
}
Expand Down

0 comments on commit c69be30

Please sign in to comment.