Unverified Commit a39eeba1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Render 404 instead of 500 if trying to see snippets of unexisting user


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 17a9ecf8
......@@ -19,6 +19,9 @@ def index
def user_index
@user = User.find_by(username: params[:username])
render_404 and return unless @user
@snippets = @user.snippets.fresh.non_expired
if @user == current_user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment