Skip to content

Commit 1056b36

Browse files
Merge pull request #13136 from nextcloud/backport/13135/stable30
[stable30] Fix call on null errors in cache docs code blocks
2 parents 159d788 + 41fa205 commit 1056b36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

developer_manual/basics/caching.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ A local cache instance can be acquired through the ``\OCP\ICacheFactory`` servic
121121
122122
public function getPicture(string $url): void {
123123
$cache = $this->cacheFactory->createLocal('my-app-pictures');
124-
$cachedPicture = $this->cache->get($url);
124+
$cachedPicture = $cache->get($url);
125125
if ($cachedPicture !== null) {
126126
return $cachedPicture;
127127
}
@@ -157,7 +157,7 @@ A distributed cache instance can be acquired through the ``\OCP\ICacheFactory``
157157
158158
public function getPicture(string $url): void {
159159
$cache = $this->cacheFactory->createDistributed('my-app-pictures');
160-
$cachedPicture = $this->cache->get($url);
160+
$cachedPicture = $cache->get($url);
161161
if ($cachedPicture !== null) {
162162
return $cachedPicture;
163163
}

0 commit comments

Comments
 (0)