diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8a6ab051e..c36ebc0b3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -16,10 +16,12 @@ class ApplicationController < ActionController::Base end def set_friends_and_status - @groups = current_user.groups - @friends = current_user.friends if current_user - @latest_status_message = StatusMessage.newest_for(current_user) if current_user - @group = params[:group] ? Group.first(:id => params[:group]) : Group.first + if current_user + @groups = current_user.groups + @friends = current_user.friends + @latest_status_message = StatusMessage.newest_for(current_user) + @group = params[:group] ? Group.first(:id => params[:group]) : Group.first + end end def count_requests