diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index bb15adf31b4f0..72af6c960a5ca 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -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) {