Skip to content

Commit

Permalink
Fixed 'Call to a member function getTotalPages() on null' error.
Browse files Browse the repository at this point in the history
  • Loading branch information
khalima committed Feb 5, 2024
1 parent 7ac6b48 commit d45b2a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hdbt.theme
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ function hdbt_preprocess_pager(&$variables): void {
$pager_manager = \Drupal::service('pager.manager');
$pager = $pager_manager->getPager($element);
// Get the total pages in the pager.
$total_pages = $pager->getTotalPages();
$total_pages = isset($pager) ? $pager->getTotalPages() : 0;

$variables['total_pages'] = $total_pages;
}
Expand Down

0 comments on commit d45b2a6

Please sign in to comment.