Skip to content

Commit

Permalink
Merge pull request #204 from kufu/fix/no_friend_schedule
Browse files Browse the repository at this point in the history
return if no profile
  • Loading branch information
kinoppyd authored May 15, 2024
2 parents 4164296 + 82b58a7 commit 838c003
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/plans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def set_attributes_for_turbo_stream
end
end

return unless @user.profile

@friends_schedules_map = @user.profile.friend_profiles.to_h do |profile|
[profile.id, profile.user.plans.find_by(event: @event)&.plan_schedules&.map(&:schedule_id) || []]
end
Expand Down

0 comments on commit 838c003

Please sign in to comment.