Skip to content

A self-hosted media server and file management system

fix: path resolver throws error when no folders exist in valid library

aminnausina0cfb9576c23
diff --git a/app/Services/PathResolverService.php b/app/Services/PathResolverService.php
index e2071969..83cd6dfe 100644
--- a/app/Services/PathResolverService.php
+++ b/app/Services/PathResolverService.php
@@ -58,7 +58,7 @@ class PathResolverService {
return $folders->where('category_id', $category->id)->find((int) $identifier);
}
- private function resolveDefaultFolder(Category $category, Collection $folders): Folder {
+ private function resolveDefaultFolder(Category $category, Collection $folders): ?Folder {
return $category->default_folder_id
? $folders->firstWhere('id', $category->default_folder_id)
: $folders->first();