Skip to content

Commit

Permalink
fix(userconfig): Don't fail the precondition if the value is not set …
Browse files Browse the repository at this point in the history
…at all

Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 19, 2024
1 parent 4d85f44 commit 394febb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/AllConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function setUserValue($userId, $appName, $key, $value, $preCondition = nu
$userPreferences = \OCP\Server::get(IUserConfig::class);
if ($preCondition !== null) {
try {
if ($userPreferences->getValueMixed($userId, $appName, $key) !== (string)$preCondition) {
if ($userPreferences->hasKey($userId, $appName, $key) && $userPreferences->getValueMixed($userId, $appName, $key) !== (string)$preCondition) {
throw new PreConditionNotMetException();
}
} catch (TypeConflictException) {
Expand Down

0 comments on commit 394febb

Please sign in to comment.