Skip to content

Commit

Permalink
Check if 'nav' key exists before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainjule committed Jun 8, 2020
1 parent e74cb26 commit 589dc8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if($currentRole == $role) {
$fieldname = $options['fieldname'];
$pages = $currentUser->$fieldname()->toPages();
$nav = $options['nav'] ? $options['nav'] : false;
$nav = array_key_exists('nav', $options) && $options['nav'] ? $options['nav'] : false;

if($pages->count()) {
foreach($pages as $page) {
Expand Down

0 comments on commit 589dc8f

Please sign in to comment.