From 394febb5d9f1ada1c6dfd0316a6a994b87c7148a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 19 Nov 2024 18:02:22 +0100 Subject: [PATCH] fix(userconfig): Don't fail the precondition if the value is not set at all Signed-off-by: Joas Schilling --- lib/private/AllConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.39.5