aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-11-19 19:05:35 +0100
committerGitHub <noreply@github.com>2024-11-19 19:05:35 +0100
commit9b11c4202f474d8cad13c78ee4515ab980a1017b (patch)
tree3e0d80bbec76992f61e3adec5eaa7381006d0108
parent4d85f44c9f3c73ed13434e450f97718a29ea2e66 (diff)
parent394febb5d9f1ada1c6dfd0316a6a994b87c7148a (diff)
downloadnextcloud-server-9b11c4202f474d8cad13c78ee4515ab980a1017b.tar.gz
nextcloud-server-9b11c4202f474d8cad13c78ee4515ab980a1017b.zip
Merge pull request #49386 from nextcloud/bugfix/47658/dont-fail-precondition-if-unset
fix(userconfig): Don't fail the precondition if the value is not set at all
-rw-r--r--lib/private/AllConfig.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php
index bb15adf31b4..72af6c960a5 100644
--- a/lib/private/AllConfig.php
+++ b/lib/private/AllConfig.php
@@ -246,7 +246,7 @@ class AllConfig implements IConfig {
$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) {