Skip to content

Commit aec0899

Browse files
committed
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>
1 parent 4793449 commit aec0899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/Files/Cache/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ public function inCache($file) {
540540
public function remove($file) {
541541
$entry = $this->get($file);
542542

543-
if ($entry) {
543+
if ($entry instanceof ICacheEntry) {
544544
$query = $this->getQueryBuilder();
545545
$query->delete('filecache')
546546
->whereFileId($entry->getId());

0 commit comments

Comments
 (0)