BigW Consortium Gitlab

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

parent 17a9ecf8
......@@ -19,6 +19,9 @@ class SnippetsController < ApplicationController
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