fix: verify that parent exists in cache when inserting

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2024-09-18 12:29:13 +02:00
parent e0fb25f846
commit 75cf17e4c4

View file

@ -265,6 +265,9 @@ class Cache implements ICache {
if (!isset($data['parent'])) {
$data['parent'] = $this->getParentId($file);
}
if ($data['parent'] === -1 && $file !== '') {
throw new \Exception('Parent folder not in filecache for ' . $file);
}
$data['name'] = basename($file);
[$values, $extensionValues] = $this->normalizeData($data);