From 38a164aa7a6a5e52971cbc39273a327a22ecc994 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 3 Sep 2015 15:41:30 +0200 Subject: [PATCH] Make sure the array exists --- lib/private/appconfig.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php index b9b5dacb16..7ee64980fd 100644 --- a/lib/private/appconfig.php +++ b/lib/private/appconfig.php @@ -161,6 +161,10 @@ class AppConfig implements IAppConfig { ]); if ($inserted) { + if (!isset($this->cache[$app])) { + $this->cache[$app] = []; + } + $this->cache[$app][$key] = $value; return true; } @@ -264,6 +268,10 @@ class AppConfig implements IAppConfig { $result = $sql->execute(); while ($row = $result->fetch()) { + if (!isset($this->cache[$row['appid']])) { + $this->cache[$row['appid']] = []; + } + $this->cache[$row['appid']][$row['configkey']] = $row['configvalue']; } $result->closeCursor();