diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php
index af26d30d8e94e7caaa5d6815f54d043aea4b3504..4e13d70371b7fd526b0c9ce8d11c03b7cf7ad663 100644
--- a/lib/private/AllConfig.php
+++ b/lib/private/AllConfig.php
@@ -215,11 +215,13 @@ class AllConfig implements \OCP\IConfig {
 		// TODO - FIXME
 		$this->fixDIInit();
 
-		if (isset($this->userCache[$userId][$appName][$key])) {
-			if ($this->userCache[$userId][$appName][$key] === (string)$value) {
-				return;
-			} else if ($preCondition !== null && $this->userCache[$userId][$appName][$key] !== (string)$preCondition) {
+		$prevValue = $this->getUserValue($userId, $appName, $key, null);
+
+		if ($prevValue !== null) {
+			if ($prevValue === (string)$value) {
 				return;
+			} else if ($preCondition !== null && $prevValue !== (string)$preCondition) {
+				throw new PreConditionNotMetException();
 			} else {
 				$qb = $this->connection->getQueryBuilder();
 				$qb->update('preferences')