diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -123,8 +123,8 @@ @problem = nil @submissions = nil else - @problem = Problem.find_by_name(params[:id]) - if not @problem.available + @problem = Problem.find_by_id(params[:id]) + if (@problem == nil) or (not @problem.available) redirect_to :action => 'list' flash[:notice] = 'Error: submissions for that problem are not viewable.' return