From bc63f0862acab457e4e6c1b848884d4366e38196 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Wed, 16 Mar 2011 11:00:30 +0100 Subject: [PATCH] Do not throw RecordNotFound in find_optional_report --- lib/report/controller.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/report/controller.rb b/lib/report/controller.rb index 3761d1ef4c..b586fcc1de 100644 --- a/lib/report/controller.rb +++ b/lib/report/controller.rb @@ -270,11 +270,8 @@ module Report::Controller if params[:id] @query = report_engine.find(params[:id].to_i, :conditions => ["(is_public = 1) OR (#{user_key} = ?)", current_user.id]) - if @query - @query.deserialize - else - raise ActiveRecord::RecordNotFound - end + @query.deserialize if @query end + rescue ActiveRecord::RecordNotFound end end