Prevent errors if no results for cover view are returned

This commit is contained in:
DariusIII
2018-05-15 12:59:13 +02:00
parent 86821a8ad2
commit ac99f4ebaf
7 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ class BooksController extends BasePageController
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
$offset = ($page - 1) * config('nntmux.items_per_cover_page');
$rslt = $book->getBookRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, $this->userdata['categoryexclusions']);
$results = $this->paginate($rslt, $rslt['_totalcount'], config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query());
$results = $this->paginate($rslt ?? [], $rslt['_totalcount'] ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query());
$maxwords = 50;
foreach ($results as $result) {
if (! empty($result->overview)) {