Skip to content

Commit

Permalink
[BUGFIX] Avoid exception when accessing uninitialized settings - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Apr 22, 2019
1 parent ab732a0 commit c5af1fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Classes/Controller/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use T3G\AgencyPack\Blog\Service\CacheService;
use T3G\AgencyPack\Blog\Service\MetaService;
use T3G\AgencyPack\Blog\Utility\ArchiveUtility;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
Expand Down Expand Up @@ -149,7 +148,7 @@ protected function initializeView(ViewInterface $view): void
*/
public function listRecentPostsAction(): void
{
$maximumItems = (int)ArrayUtility::getValueByPath($this->settings, 'lists.posts.maximumDisplayedItems', '.') ?: 0;
$maximumItems = (int) (isset($this->settings['lists']['posts']['maximumDisplayedItems']) ? $this->settings['lists']['posts']['maximumDisplayedItems'] : 0);

$posts = (0 === $maximumItems)
? $this->postRepository->findAll()
Expand Down

0 comments on commit c5af1fa

Please sign in to comment.