From 1c45fb61783a665dfcedeb85a53685b7cdfced39 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Fri, 12 Sep 2025 14:47:56 +0530 Subject: [PATCH] fix: fallback for empty file paths in Source construction Signed-off-by: Anupam Kumar --- lib/BackgroundJobs/IndexerJob.php | 2 +- lib/Service/ScanService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/BackgroundJobs/IndexerJob.php b/lib/BackgroundJobs/IndexerJob.php index 632793f3..cd1c00ca 100644 --- a/lib/BackgroundJobs/IndexerJob.php +++ b/lib/BackgroundJobs/IndexerJob.php @@ -233,7 +233,7 @@ protected function index(array $files): void { $sources[] = new Source( $userIds, ProviderConfigService::getSourceId($file->getId()), - $file->getInternalPath(), + $file->getInternalPath() ?: $file->getPath() ?: $file->getName(), $fileHandle, $file->getMtime(), $file->getMimeType(), diff --git a/lib/Service/ScanService.php b/lib/Service/ScanService.php index 70406d76..9628859e 100644 --- a/lib/Service/ScanService.php +++ b/lib/Service/ScanService.php @@ -114,7 +114,7 @@ public function getSourceFromFile(array $mimeTypeFilter, File $node): ?Source { $providerKey = ProviderConfigService::getDefaultProviderKey(); $sourceId = ProviderConfigService::getSourceId($node->getId()); $userIds = $this->storageService->getUsersForFileId($node->getId()); - $path = $node->getInternalPath(); + $path = $node->getInternalPath() ?: $node->getPath() ?: $node->getName(); return new Source( $userIds, $sourceId,