diff --git a/app/controllers/repository_rows_controller.rb b/app/controllers/repository_rows_controller.rb index 23e920e6e..eb969ca80 100644 --- a/app/controllers/repository_rows_controller.rb +++ b/app/controllers/repository_rows_controller.rb @@ -52,9 +52,9 @@ class RepositoryRowsController < ApplicationController def show @repository_row = RepositoryRow.find_by(id: params[:id]) - if !can_read_repository?(@repository_row.repository) || @repository_row.repository_id != params[:repository_id].to_i - return render_403 - end + return render_404 unless @repository_row + return render_404 unless @repository_row.repository_id == params[:repository_id].to_i + return render_403 unless can_read_repository?(@repository_row.repository) @assigned_modules = @repository_row.my_modules.joins(experiment: :project) @viewable_modules = @assigned_modules.viewable_by_user(current_user, current_user.teams)