Permalink
Browse files

Fix for issues 3026, 3027 (error 500 on non-existent things)

(The path of least resistance: just check not nil)
  • Loading branch information...
1 parent e1f4b32 commit 02b4d539b7691f42194e1e7cc946c49910515723 @CristinaRO CristinaRO committed May 2, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 app/controllers/bookmarks_controller.rb
@@ -60,15 +60,15 @@ def index
if params[:user_id]
# @user is needed in the sidebar
owner = @user = User.find_by_login(params[:user_id])
- @page_subtitle = ts("by ") + @user.login
+ @page_subtitle = ts("by ") + @user.login if @user
if params[:pseud_id] && @user
# @author is needed in the sidebar
owner = @author = @user.pseuds.find_by_name(params[:pseud_id])
- @page_subtitle = ts("by ") + @author.byline
+ @page_subtitle = ts("by ") + @author.byline if @author
end
elsif params[:tag_id]
owner ||= Tag.find_by_name(params[:tag_id])
- @page_subtitle = owner.name
+ @page_subtitle = owner.name if owner
elsif @collection
@page_subtitle = @collection.title
owner ||= @collection # insufficient to filter out unapproved bookmarks, see below

0 comments on commit 02b4d53

Please sign in to comment.