diff --git a/app/controllers/protips_controller.rb b/app/controllers/protips_controller.rb index 9aebd421..f767338a 100644 --- a/app/controllers/protips_controller.rb +++ b/app/controllers/protips_controller.rb @@ -430,7 +430,11 @@ def expand_query(query_string) end def lookup_protip - @protip = Protip.find_by_public_id(params.permit(:id)[:id].downcase) + @protip = if public_id = params[:id] + Protip.find_by_public_id(public_id.downcase) + else + nil + end end def choose_protip_layout