fix(userconfig): Don't fail the precondition if the value is not set at all

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/49386/head
Joas Schilling 1 year ago
parent 4d85f44c9f
commit 394febb5d9
No known key found for this signature in database
GPG Key ID: F72FA5B49FFA96B0
  1. 2
      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) {

Loading…
Cancel
Save