mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Check whether entry is of type ICacheEntry in Cache->remove()
In some scenarios (file not in cache, but partial data of it in the object), Cache->get() might return an array, which leads to errors like "Call to a member function getId() on array". So check whether the returned entry is of type ICacheEntry before doing operations on it in Cache->remove(). Fixes: #33023 Signed-off-by: Jonas <jonas@freesources.org>
This commit is contained in:
parent
46a49dee8a
commit
7d07e06bfe
1 changed files with 1 additions and 1 deletions
|
|
@ -540,7 +540,7 @@ class Cache implements ICache {
|
|||
public function remove($file) {
|
||||
$entry = $this->get($file);
|
||||
|
||||
if ($entry) {
|
||||
if ($entry instanceof ICacheEntry) {
|
||||
$query = $this->getQueryBuilder();
|
||||
$query->delete('filecache')
|
||||
->whereFileId($entry->getId());
|
||||
|
|
|
|||
Loading…
Reference in a new issue