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

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-11-19 18:02:22 +01:00
parent 4d85f44c9f
commit 394febb5d9
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0

View 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) {