]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(userconfig): Don't fail the precondition if the value is not set at all bugfix/47658/dont-fail-precondition-if-unset 49386/head
authorJoas Schilling <coding@schilljs.com>
Tue, 19 Nov 2024 17:02:22 +0000 (18:02 +0100)
committerJoas Schilling <coding@schilljs.com>
Tue, 19 Nov 2024 17:02:22 +0000 (18:02 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/AllConfig.php

index bb15adf31b4f0eb9e01296f65695e723ca309658..72af6c960a5ca8fc7b8175553cac05d709c34ffc 100644 (file)
@@ -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) {