mirror of
https://github.com/nextcloud/server.git
synced 2026-03-01 04:50:40 -05: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
47934494f6
commit
aec0899efd
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