From: Joas Schilling Date: Tue, 19 Nov 2024 17:02:22 +0000 (+0100) Subject: fix(userconfig): Don't fail the precondition if the value is not set at all X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F49386%2Fhead;p=nextcloud-server.git fix(userconfig): Don't fail the precondition if the value is not set at all Signed-off-by: Joas Schilling --- 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) {