Removed bang operator from account, tag finders in home_controller

If account or tag does not exist, it tosses an error. without bang it ignores if doesn't exist.
This commit is contained in:
mgabdev 2019-08-17 12:16:15 -04:00
parent 1e6cf79f9e
commit 5750786d1a
1 changed files with 3 additions and 3 deletions

View File

@ -14,9 +14,9 @@ class HomeController < ApplicationController
def set_data_for_meta def set_data_for_meta
if params[:username].present? if params[:username].present?
@account = Account.find_local!(params[:username]) @account = Account.find_local(params[:username])
elsif params[:account_username].present? elsif params[:account_username].present?
@account = Account.find_local!(params[:account_username]) @account = Account.find_local(params[:account_username])
if params[:id].present? if params[:id].present?
@status = @account.statuses.find(params[:id]) @status = @account.statuses.find(params[:id])
@ -26,7 +26,7 @@ class HomeController < ApplicationController
end end
if request.path.starts_with?('/tags') && params[:tag].present? if request.path.starts_with?('/tags') && params[:tag].present?
@tag = Tag.find_normalized!(params[:tag]) @tag = Tag.find_normalized(params[:tag])
end end
end end