Skip to content

Commit

Permalink
Fix assets not showing when there's no folders
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Jul 10, 2024
1 parent b6d06d6 commit 4e6714c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Controllers/CP/Assets/BrowserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function folder(Request $request, $container, $path = '/')
$folders = $folder->assetFolders();
$totalFolders = $folders->count();
$folders = $folders->slice(($page - 1) * $perPage, $perPage);
$lastFolderPage = (int) ceil($totalFolders / $perPage);
$lastFolderPage = (int) ceil($totalFolders / $perPage) ?: 1;

$totalAssets = $folder->queryAssets()->count();
$totalItems = $totalAssets + $totalFolders;
Expand Down

0 comments on commit 4e6714c

Please sign in to comment.