diff options
author | tony <tony> | 2009-04-23 12:17:06 +0000 |
---|---|---|
committer | tony <tony> | 2009-04-23 12:17:06 +0000 |
commit | b28e402f051ba3d9430953d039730750754c5780 (patch) | |
tree | c00cf0ab397ed85f51270dac6d085568af87220f /app/controllers/user_controller.rb | |
parent | ad9995c0b4f0823603251a95f7a9a44b4f2aec5c (diff) |
Empty list of updates if not logged in
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r-- | app/controllers/user_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 9a8b92e81..6d3cb3480 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_controller.rb,v 1.65 2009-04-14 14:51:00 tony Exp $ +# $Id: user_controller.rb,v 1.66 2009-04-23 12:17:06 tony Exp $ class UserController < ApplicationController # Show page about a user @@ -263,7 +263,7 @@ class UserController < ApplicationController # River of News: What's happening with your tracked things def river - @results = @user.track_things.collect { |thing| + @results = @user.nil? ? [] : @user.track_things.collect { |thing| perform_search([InfoRequestEvent], thing.track_query, thing.params[:feed_sortby], nil).results }.flatten.sort { |a,b| b[:model].created_at <=> a[:model].created_at }.first(20) end |