From 5750786d1ab180caa22bd2861e82959b621e3a67 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Sat, 17 Aug 2019 12:16:15 -0400 Subject: [PATCH] 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. --- app/controllers/home_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 64de0d20..242f5efd 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -14,9 +14,9 @@ class HomeController < ApplicationController def set_data_for_meta if params[:username].present? - @account = Account.find_local!(params[:username]) + @account = Account.find_local(params[:username]) elsif params[:account_username].present? - @account = Account.find_local!(params[:account_username]) + @account = Account.find_local(params[:account_username]) if params[:id].present? @status = @account.statuses.find(params[:id]) @@ -26,7 +26,7 @@ class HomeController < ApplicationController end if request.path.starts_with?('/tags') && params[:tag].present? - @tag = Tag.find_normalized!(params[:tag]) + @tag = Tag.find_normalized(params[:tag]) end end