Skip to content

Commit

Permalink
Merge pull request #157 from TelosLabs/add-safe-navigators
Browse files Browse the repository at this point in the history
Fix error when there are no Sessions
  • Loading branch information
andresag4 authored Sep 3, 2024
2 parents bbb1e86 + c463a1a commit 592f320
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def show
private

def sessions
current_conference&.sessions
Session.where(conference: current_conference)
end

def filter_params
Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/_filters.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="flex justify-between w-full mb-4" data-controller="preserve-scroll">
<div id="<%= resource %>_filters" class="flex items-center gap-2 overflow-x-scroll no-scrollbar" data-preserve-scroll>
<% current_conference.dates.each do |session_date| %>
<% current_conference&.dates&.each do |session_date| %>
<%= link_to(
session_date.strftime("%a, %d"),
url_for([resource, session_filter_params.to_h.merge(starts_at: session_date)]) + current_day_anchor(session_date),
Expand Down

0 comments on commit 592f320

Please sign in to comment.