Skip to content

Commit 4401d20

Browse files
committed
Ensure that current_person exists before checking the policy
1 parent 15562e4 commit 4401d20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/layouts/better_together/_mobile_bar.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="mobile-bar" class="container-fluid shadow-sm d-lg-none">
22
<nav class="d-flex justify-content-around align-items-center py-4" aria-label='<%= t('better_together.mobile_bar.navigation') %>'>
3-
<% if policy(current_person).show? %>
3+
<% if current_person && policy(current_person).show? %>
44
<%= link_to person_my_profile_path(person_id: current_person.slug), class: "text-light", aria: { label: t('better_together.mobile_bar.profile') }, data: { bs_toggle: "tooltip", bs_placement: "top", bs_title: t('better_together.mobile_bar.profile') } do %>
55
<i class="fas fa-user fa-2x" aria-hidden="true"></i>
66
<span class="visually-hidden"><%= t('better_together.mobile_bar.profile') %></span>

0 commit comments

Comments
 (0)