fix: verify that parent exists in cache when inserting

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/48213/head
Robin Appelman 2024-09-18 12:29:13 +07:00 committed by Louis
parent 0dacf09779
commit 78637be4cd
1 changed files with 3 additions and 0 deletions

@ -306,6 +306,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);