Skip to content

Commit

Permalink
Fix the bug that activities#index will crash when no current team
Browse files Browse the repository at this point in the history
  • Loading branch information
ifournight committed Apr 10, 2017
1 parent a345a44 commit e579043
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ActivitiesController < ApplicationController
def index
@activities = []
if Team.exists?(session[:team_id])
@team = Team.find session[:team_id]
projects = current_user.anticipated_projects_in_team(@team)
Expand Down
5 changes: 3 additions & 2 deletions app/views/activities/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%= content_tag :section, class: 'section', id: "activities-team_#{@team.id}" do %>
<% if @activities.any? %>
<% if @activities.any? %>
<%= content_tag :section, class: 'section', id: "activities-team_#{@team.id}" do %>


<% @by_day_groups.each do |by_day_group| %>

Expand Down

0 comments on commit e579043

Please sign in to comment.