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>
public function remove($file) {
$entry = $this->get($file);
- if ($entry) {
+ if ($entry instanceof ICacheEntry) {
$query = $this->getQueryBuilder();
$query->delete('filecache')
->whereFileId($entry->getId());